- <!--------------------------------分页------------------------------>
- {dede:pagelist listitem="info,index,end,pre,next,pageno" listsize="5"/}
- <!--------------------------------引入文件------------------------------>
- {dede:include filename="head.htm"/}引入
- <!--------------------------------简介长度调用------------------------------>
- field:description function='cn_substr(@me,200)'/] list简介长度
- <!--------------------------------当前栏目调用------------------------------>
- {dede:field.typename/}
- <!--------------------------------内容页调用栏目名称跟链接------------------------>
- <a href="{dede:field.typeurl/}">{dede:field.typename/}</a>
- <!--------------------------------导航有英文 加下级文件------------------------------>
- {dede:channelartlist typeid='top' currentstyle='active' row="6"}
- <li class="dropdown {dede:field.currentstyle/}"><a class="dropdown-toggle" data-toggle="dropdown" href="{dede:field name='typeurl'/}">{dede:field name='typename'/}<small>{dede:field.typenameen/}</small></a>
- <ul class="dropdown-menu dropdown-menu-left">
- {dede:channel type='son' noself='yes'}
- <li><a href="[field:typeurl/]">[field:typename/]</a></li>
- {/dede:channel}
- </ul>
- </li>
- {/dede:channelartlist}
- <!--------------------------------自定义调用内容页------------------------------>
- channelid="1" addfields='body'
- [field:body/]
- <!---------------------一条红线--------------------->
- <p style="border-bottom:2px solid red;width:100%;align:center;"></p>
- <!---------------------查询多个typeid--------------------->
- typeid='1,7,12,18,22,29'
- (1)某一id导航栏下的二级导航栏
- {dede:channel type='sun' typeid='1' row='8' }
- <li> <a id="nav_zhoubian" href="[field:typeurl/]" target="_self" >[field:typename/]<i></i></a></li>
- {/dede:channel}
- (2)表示指定单个栏目的链接 typeid指定栏目id
- {dede:type typeid ='21'}
- <a href="[field:typelink/]">[field:typename/]</a>
- {/dede:type}
- 栏目表dede_arctype
- (3)显示一级导航栏及二级导航栏
- {dede:channelartlist row=7 typeid='top' orderby="id" orderway="asc"}
- <li {dede:field name='currentstyle'/}><a href="{dede:field name='typeurl'/}">{dede:field name='typename'/}</a>
- <ul class="sub">
- {dede:channel type='son' noself='yes'}
- <li class="sub"><a class="sub" href="[field:typelink/]">[field:typename/]</a></li>
- {/dede:channel}
- </ul>
- </li>
- {/dede:channelartlist}
- (4)当前栏目导航栏被选中状态
- <ul>
- <li class="on"><a href="/">首页</a><br/><a href="/" class='dd'>Home</a></li>
- {dede:channel type='top' row='10' currentstyle="
- <li class='hover'><a href='~typelink~' ~rel~><span>~typename~</a><br/><a href='~typelink~' class='dd' ~rel~>~typenameen~</span></a></li>
- "}
- <li><a href="[field:typeurl/]">[field:typename/]</a><br />
- <a href="[field:typeurl/]" class='dd'>[field:typenameen/]</a></li>
- {/dede:channel}
- </ul>
- (5)当前栏目导航栏被选中状态2
- {dede:channel type='sun' row='5' currentstyle="
- <li class='cur'><a href='~typelink~' ~rel~>~typename~</a></li>
- "}
- <li><a href="[field:typeurl/]">[field:typename/]</a></li>
- {/dede:channel}
- (6)显示一级导航栏及二级导航栏,并当前栏目导航栏被选中状态
- {dede:channelartlist row=8 typeid='top' orderby="id" orderway="asc" currentstyle="<li class='active has-sub'>"}
- <li {dede:field name='currentstyle'/}><a href="{dede:field name='typeurl'/}">{dede:field name='typename'/}</a>
- <ul>
- {dede:channel type='son' noself='yes'}
- <li class='has-sub'><a href="[field:typelink/]">[field:typename/]</a></li>
- {/dede:channel}
- </ul>
- </li>
- {/dede:channelartlist}
- 或是这种写法
- {dede:channelartlist typeid='top' currentstyle='active' row="6"}
- <li class="dropdown {dede:field.currentstyle/}"><a class="dropdown-toggle" data-toggle="dropdown" href="{dede:field name='typeurl'/}">{dede:field name='typename'/}<small>{dede:field.typenameen/}</small></a>
- <ul class="dropdown-menu dropdown-menu-left">
- {dede:channel type='son' noself='yes'}
- <li><a href="[field:typeurl/]">[field:typename/]</a></li>
- {/dede:channel}
- </ul>
- </li>
- {/dede:channelartlist}
- (7)显示一级导航栏及二级导航栏,当前栏目导航栏被选中状态,进入二级栏目时,一级栏目的导航栏也是选中状态
- dede_type表内,二级栏目的topid必须一级栏目的id
- {dede:channelartlist typeid='top' currentstyle='active' row="5"}
- <li class="dropdown {dede:field.currentstyle/}"><a class="dropdown-toggle" data-toggle="dropdown" href="{dede:field name='typeurl'/}">{dede:field name='typename'/}<small>{dede:field.typenameen/}</small></a>
- <ul class="dropdown-menu dropdown-menu-left">
- {dede:channel type='son' noself='yes'}
- <li><a href="[field:typeurl/]">[field:typename/]</a></li>
- {/dede:channel}
- </ul>
- </li>
- {/dede:channelartlist}
- (8)显示某一顶级导航栏下的二级三级导航栏
- {dede:channelartlist typeid='top' typeid='53'}
- <li><h3 ><a href='{dede:field name='typeurl'/}' class="depth_2"><span class="icon10"></span>二级{dede:field name='typename'/}</a></h3> <ul>
- {dede:sql sql='Select * from dede_arctype where reid=~id~ ORDER BY id limit 00,20'}
- <li><a href="[field:typedir function='str_replace("{cmspath}","",@me)'/]" class="depth_3">三级[field:typename/]</a></li>
- {/dede:sql}
- </ul>
- </li>
- {/dede:channelartlist}
- (9)channelartlist指定导航栏的id输出
- {dede:channelartlist typeid='1,2,3,4,5' }
- <li class="line"></li>
- <li id='nav_1' style='width:125px;' ><a href='{dede:field name='typeurl'/}' 0 title='{dede:field name='typename'/}' class='hover-none nav'><span>{dede:field name='typename'/}</span></a>
- <dl>
- {dede:channel type='son' noself='yes' }
- <dd><a href='[field:typelink/]' title='[field:typename/]' >[field:typename/]</a></dd>
- {/dede:channel}
- </dl>
- </li>
- {/dede:channelartlist}
- (10)输出某一级栏目下的二级栏目,及二级栏目下的几条文章
- {dede:channelartlist typeid="20"}
- <a href="{dede:field name='typeurl'/}">{dede:field name='typename'/}
- {dede:arclist row="8"}<a href="[field:arcurl/]">[field:title /]</a>{/dede:arclist}
- {/dede:channelartlist}
- <!---------------------arclist显示某分类的前5条新闻 flag='c'即推荐 列表也显示body数据--------------------->
- {dede:arclist typeid="24" channelid="1" addfields='body' titlelen='45' row="5" flag='c'}
- <div class="news">
- <img src="[field:litpic/]" alt="[field:title/]" />
- <img src="[field:picname/]" />
- [field:global name=autoindex runphp="yes"]@me=@me;[/field:global]
- <a href='[field:typeurl/]'>[field:typename/]</a>
- <a style="float:left" href="[field:arcurl/]" target="_blank">[field:title/]</a>
- [field:description function='cn_substr(html2text(@me),2)'/]
- [field:description function='cn_substr(Html2text("@me")."...",80)'/]
- [field:body function='cn_substr(html2text(@me),200)'/]
- [field:title function='( strlen("@me")>42 ? cn_substr("@me",42)."…" : "@me" ) ' /]
- <span style="float:right">
- [field:pubdate function="MyDate('Y-m-d',@me)"/]
- [field:pubdate function='strftime("%b %d, %Y",@me)'/]
- [field:pubdate function=strftime('%Y-%m-%d',@me)/]
- [field:pubdate function="GetDateTimeMK(@me)"/]
- </span>
- </div>
- {/dede:arclist}
- 文章详细页/*文章浏览数*/
- <script src="{dede:field name='phpurl'/}/count.php?view=yes&aid={dede:field name='id'/}&mid={dede:field name='mid'/}"type='text/javascript' language="javascript"></script>
- 指定文章id输出
- {dede:arclist idlist='2' titlelen='50'}
- <li>
- <div class="image"><a href="[field:arcurl/]"><img src="[field:litpic/]" /></a></div>
- <div class="text">
- <span class="title">NEWS:</span>
- <p><a href="[field:arcurl/]">[field:title/]...</a></p>
- </div>
- <a class="link link2" href="[field:arcurl/]">关于我们</a>
- </li>
- {/dede:arclist}
- 根据当前typeid输出
- {dede:arclist type="~typeid~" titlelen='51' row=10 orderby='sortrank' }
- <div class="single-grid inner_show">
- <div class="lone-line">
- <h4><a href="[field:arcurl/]" target="_blank">[field:title/]</a></h4>
- <ul class="sin-grid">
- <li><a href="[field:arcurl/]"><span class="clock"> </span>[field:pubdate function=MyDate('Y-m-d',@me)/]</a></li>
- <!--<li><a href="[field:arcurl/]"><span class="share"> </span>集团要闻</a></li>--------------------->
- </ul>
- </div>
- </div>
- {/dede:arclist}
- 显示自定义的arclist的字段,加channelid 加addfields字段
- {dede:arclist pagesize='12' typeid='10' channelid='2' addfields='wuxing,shuzi,ptitle,palt,tlink'}
- {/dede:arclist}
- <!---------------------分页显示新闻--------------------->
- <div class="xinwen_box">
- {dede:list pagesize='6' titlelen='36'}
- <div class="lie-box">
- <a href="[field:arcurl/]" >
- <p class="xw-lt">
- [field:title/]
- </p>
- </a>
- </div>
- {/dede:list}
- <div class="pages"> {dede:pagelist listitem="index,end,pre,next,pageno" listsize="7"/} </div>
- </div>
- <!---------------------{dede:global.cfg_sj/}显示系统的数据调用sysconfig表里的数据--------------------->
- <!---------------------sql语句调用数据--------------------->
- 查询栏目内容
- {dede:sql sql='Select content from "#@__arctype" where id=1'}
- [field:content/]
- {/dede:sql}
- 查询文章
- {dede:sql sql="SELECT * FROM dede_archives where typeid2 in(13,14,15,16,17,18) and typeid=6 order by pubdate DESC limit 5 "}
- <li><a href='[field:id runphp='yes'] $id=@me;@me='';$url=GetOneArchive($id);@me=$url['arcurl'];[/field:id]' title="[field:title/]" target="_blank"><b>[field:title function=cn_substr(@me,60)/]</b></a></li>
- {/dede:sql}
- 查询栏目
- {dede:sql sql="SELECT * From `#@__arctype`
- WHERE topid=1 And letter LIKE '%a%' or letter LIKE '%b' or letter LIKE '%c%' order by letter asc"}
- <li><a href="[field:typedir function='str_replace("{cmspath}","",@me)'/]">[field:typename/]</a></li>
- {/dede:sql}
- <!---------------------根据typeid输出数据--------------------->
- {dede:type type="~typeid~"}[field:typename/]{/dede:type}
- <!---------------------设置[field:description/]的字数--------------------->
- [field:description function='cn_substr(Html2text("@me")."...",80)'/]
- <!---------------------当前位置--------------------->
- {dede:field name='position'/}
- 英文版
- {dede:field name='position' function='str_replace("首页","Home",Html2Text("@me"))'/}
- <!---------------------调用共用页面--------------------->
- {dede:include filename="footer.htm"/}
- <!---------------------ShowMsg()跳转到哪个页面--------------------->
- <!---------------------文章详细页,输出图片集的所有图片--------------------->
- (输出所有)
- {dede:productimagelist}
- <li class="now"> <a href="[field:imgsrc/]" target="_blank"><img longdesc="[field:imgsrc/]" src="[field:imgsrc/]" width="96" height="76"></a> </li>
- {/dede:productimagelist}
- (输出第一张)
- {dede:field name='imgurls' alt='图片输出区'}
- <a class="jqzoom" href="[field:imgsrc/]"> <img src="[field:imgsrc/]" alt="" class="js_goods_image_url" style="width: 520px;" /> </a>
- {/dede:field}
- <!---------------------热门标签--------------------->
- 参数说明:
- num:关键词数目
- subday:天数
- maxlength:关键词最大长度
- {dede:hotwords num='6' /}
- //页面输出内容:
- <a href='/plus/search.php?keyword=ibm'>ibm</a>
- <a href='/plus/search.php?keyword=htc'>htc</a>
- <a href='/plus/search.php?keyword=dedecms'>dedecms</a>
- <!---------------------搜索--------------------->
- <form name="formsearch" action="{dede:global.cfg_cmsurl/}/plus/search.php" autocomplete="off">
- <div class="form">
- <h4>搜索</h4>
- <input type="hidden" name="kwtype" value="0" />
- <input name="q" type="text" class="search-keyword" id="search-keyword" placeholder="在这里搜索..." value="在这里搜索..." onfocus="if(this.value=='在这里搜索...'){this.value='';}" onblur="if(this.value==''){this.value='在这里搜索...';}" />
- <input type="text" autocomplete="off" name="q" id="searchkey" placeholder="在这里搜索..." maxlength="60" onfocus="if (value =='在这里搜索...'){value =''}"onblur="if (value ==''){value='在这里搜索...'}">
- <select name="searchtype" class="search-option" id="search-option">
- <option value="title" selected='1'>检索标题</option>
- <option value="titlekeyword">智能模糊</option>
- </select>
- <button type="submit" class="search-submit">搜索</button>
- </div>
- </form>
- form禁止enter键提交最后面加上 onkeydown="if(event.keyCode==13)return false;"
- <form name="formsearch" action="{dede:global.cfg_cmsurl/}/plus/search.php" onkeydown="if(event.keyCode==13)return false;">
- <form action="" autocomplete="off" method="post">//autocomplete="off" 清空数据
- echo "<script>alert('提交成功!'); window.history.go(-1)</script>";//返回当前页
- 15.指定id加class
- $(function(){
- $("#7").addClass("active");
- })
- <!---------------------文章详细页跳转到列表页--------------------->
- <a href="{dede:type typeid='0' row=1}[field:typelink function='str_replace("/index.html","",@me)' /]{/dede:type}" class="btn btn-default">全部</a>
- 17.当前是首页的话,导航栏首页高亮效果
- <li {dede:field name=typeid runphp="yes"}(@me=="")? @me=" class='on' ":@me="";{/dede:field}>首页</li>

我的微信
这是我的微信扫一扫