织梦dedecms标签调用集合,史上最全,仿站必备

  1. <!--------------------------------分页------------------------------>
  2. {dede:pagelist listitem="info,index,end,pre,next,pageno" listsize="5"/}
  3. <!--------------------------------引入文件------------------------------>
  4. {dede:include filename="head.htm"/}引入
  5. <!--------------------------------简介长度调用------------------------------>
  6. field:description function='cn_substr(@me,200)'/]   list简介长度
  7. <!--------------------------------当前栏目调用------------------------------>
  8. {dede:field.typename/}
  9. <!--------------------------------内容页调用栏目名称跟链接------------------------>
  10. <a href="{dede:field.typeurl/}">{dede:field.typename/}</a>
  11. <!--------------------------------导航有英文  加下级文件------------------------------>
  12. {dede:channelartlist typeid='top' currentstyle='active' row="6"}
  13.         <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>
  14.           <ul class="dropdown-menu dropdown-menu-left">
  15.             {dede:channel type='son' noself='yes'}
  16.             <li><a href="[field:typeurl/]">[field:typename/]</a></li>
  17.             {/dede:channel}
  18.           </ul>
  19.         </li>
  20.         {/dede:channelartlist}
  21. <!--------------------------------自定义调用内容页------------------------------>
  22. channelid="1"   addfields='body'
  23. [field:body/]
  24. <!---------------------一条红线--------------------->
  25. <p style="border-bottom:2px solid red;width:100%;align:center;"></p>
  26. <!---------------------查询多个typeid--------------------->
  27. typeid='1,7,12,18,22,29'
  28. (1)某一id导航栏下的二级导航栏
  29. {dede:channel type='sun' typeid='1' row='8' }
  30.      <li> <a id="nav_zhoubian" href="[field:typeurl/]" target="_self" >[field:typename/]<i></i></a></li>
  31.       {/dede:channel}
  32. (2)表示指定单个栏目的链接 typeid指定栏目id
  33. {dede:type  typeid ='21'}
  34.                 <a href="[field:typelink/]">[field:typename/]</a>
  35.             {/dede:type}
  36. 栏目表dede_arctype
  37. (3)显示一级导航栏及二级导航栏
  38. {dede:channelartlist row=7  typeid='top' orderby="id" orderway="asc"}
  39.                         <li {dede:field name='currentstyle'/}><a href="{dede:field name='typeurl'/}">{dede:field name='typename'/}</a>
  40.                           <ul class="sub">
  41.                            {dede:channel type='son' noself='yes'}
  42.                             <li class="sub"><a class="sub" href="[field:typelink/]">[field:typename/]</a></li>
  43.                             {/dede:channel}
  44.                           </ul>
  45.                         </li>
  46.                         {/dede:channelartlist}
  47. (4)当前栏目导航栏被选中状态
  48.      <ul>
  49.       <li class="on"><a href="/">首页</a><br/><a href="/" class='dd'>Home</a></li>
  50.       {dede:channel type='top' row='10' currentstyle="
  51.       <li class='hover'><a href='~typelink~' ~rel~><span>~typename~</a><br/><a href='~typelink~' class='dd'  ~rel~>~typenameen~</span></a></li>
  52.       "}
  53.       <li><a href="[field:typeurl/]">[field:typename/]</a><br />
  54.              <a href="[field:typeurl/]" class='dd'>[field:typenameen/]</a></li>
  55.       {/dede:channel}
  56.     </ul>
  57. (5)当前栏目导航栏被选中状态2
  58.      {dede:channel type='sun' row='5' currentstyle="
  59.       <li class='cur'><a href='~typelink~' ~rel~>~typename~</a></li>
  60.       "}
  61.       <li><a href="[field:typeurl/]">[field:typename/]</a></li>
  62.       {/dede:channel}
  63. (6)显示一级导航栏及二级导航栏,并当前栏目导航栏被选中状态
  64. {dede:channelartlist row=8  typeid='top' orderby="id" orderway="asc" currentstyle="<li class='active has-sub'>"}
  65.                         <li {dede:field name='currentstyle'/}><a href="{dede:field name='typeurl'/}">{dede:field name='typename'/}</a>
  66.                           <ul>
  67.                            {dede:channel type='son' noself='yes'}
  68.                             <li class='has-sub'><a href="[field:typelink/]">[field:typename/]</a></li>
  69.                             {/dede:channel}
  70.                           </ul>
  71.                         </li>
  72.                         {/dede:channelartlist}
  73. 或是这种写法
  74.  {dede:channelartlist typeid='top' currentstyle='active' row="6"}
  75.         <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>
  76.           <ul class="dropdown-menu dropdown-menu-left">
  77.             {dede:channel type='son' noself='yes'}
  78.             <li><a href="[field:typeurl/]">[field:typename/]</a></li>
  79.             {/dede:channel}
  80.           </ul>
  81.         </li>
  82.         {/dede:channelartlist}
  83. (7)显示一级导航栏及二级导航栏,当前栏目导航栏被选中状态,进入二级栏目时,一级栏目的导航栏也是选中状态
  84. dede_type表内,二级栏目的topid必须一级栏目的id
  85.   {dede:channelartlist typeid='top' currentstyle='active' row="5"}
  86.         <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>
  87.           <ul class="dropdown-menu dropdown-menu-left">
  88.             {dede:channel type='son' noself='yes'}
  89.             <li><a href="[field:typeurl/]">[field:typename/]</a></li>
  90.             {/dede:channel}
  91.           </ul>
  92.         </li>
  93.         {/dede:channelartlist}
  94. (8)显示某一顶级导航栏下的二级三级导航栏
  95.   {dede:channelartlist typeid='top'  typeid='53'}
  96.                    <li><h3 ><a href='{dede:field name='typeurl'/}' class="depth_2"><span class="icon10"></span>二级{dede:field name='typename'/}</a></h3>                  <ul>
  97.                           {dede:sql sql='Select * from dede_arctype where reid=~id~  ORDER BY id limit 00,20'}
  98.                           <li><a href="[field:typedir function='str_replace("{cmspath}","",@me)'/]"  class="depth_3">三级[field:typename/]</a></li>
  99.                           {/dede:sql}
  100.                          </ul>
  101.                    </li>
  102.                   {/dede:channelartlist}
  103. (9)channelartlist指定导航栏的id输出
  104.  {dede:channelartlist  typeid='1,2,3,4,5' }
  105.    <li class="line"></li>
  106.    <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>
  107.    <dl>
  108.     {dede:channel type='son' noself='yes' }
  109.    <dd><a href='[field:typelink/]' title='[field:typename/]' >[field:typename/]</a></dd>
  110.  {/dede:channel}
  111.    </dl>
  112.    </li>
  113.      {/dede:channelartlist}
  114. (10)输出某一级栏目下的二级栏目,及二级栏目下的几条文章
  115. {dede:channelartlist typeid="20"}
  116.     <a href="{dede:field name='typeurl'/}">{dede:field name='typename'/}
  117.     {dede:arclist row="8"}<a href="[field:arcurl/]">[field:title /]</a>{/dede:arclist}
  118. {/dede:channelartlist}
  119. <!---------------------arclist显示某分类的前5条新闻  flag='c'即推荐  列表也显示body数据--------------------->
  120. {dede:arclist typeid="24" channelid="1" addfields='body' titlelen='45' row="5" flag='c'}
  121.     <div class="news">
  122. <img src="[field:litpic/]" alt="[field:title/]" />
  123. <img src="[field:picname/]" />
  124. [field:global name=autoindex runphp="yes"]@me=@me;[/field:global]
  125. <a href='[field:typeurl/]'>[field:typename/]</a>
  126.     <a style="float:left" href="[field:arcurl/]" target="_blank">[field:title/]</a>
  127. [field:description function='cn_substr(html2text(@me),2)'/]
  128. [field:description function='cn_substr(Html2text("@me")."...",80)'/]
  129. [field:body function='cn_substr(html2text(@me),200)'/]
  130. [field:title function='( strlen("@me")>42 ? cn_substr("@me",42)."…" : "@me" ) ' /]
  131.     <span style="float:right">
  132.         [field:pubdate function="MyDate('Y-m-d',@me)"/]
  133.         [field:pubdate function='strftime("%b %d, %Y",@me)'/]
  134.                 [field:pubdate function=strftime('%Y-%m-%d',@me)/]
  135.                 [field:pubdate function="GetDateTimeMK(@me)"/]
  136.        </span>
  137.     </div>
  138.     {/dede:arclist}
  139. 文章详细页/*文章浏览数*/
  140. <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>
  141. 指定文章id输出
  142. {dede:arclist idlist='2' titlelen='50'}
  143.         <li>
  144.             <div class="image"><a href="[field:arcurl/]"><img src="[field:litpic/]" /></a></div>
  145.             <div class="text">
  146.                 <span class="title">NEWS:</span>
  147.                 <p><a href="[field:arcurl/]">[field:title/]...</a></p>
  148.             </div>
  149.             <a class="link link2" href="[field:arcurl/]">关于我们</a>
  150.         </li>
  151.     {/dede:arclist}
  152. 根据当前typeid输出
  153. {dede:arclist type="~typeid~"  titlelen='51' row=10 orderby='sortrank' }
  154.                     <div class="single-grid inner_show">
  155.                         <div class="lone-line">
  156.                             <h4><a href="[field:arcurl/]" target="_blank">[field:title/]</a></h4>
  157.                             <ul class="sin-grid">
  158.                                 <li><a href="[field:arcurl/]"><span class="clock"> </span>[field:pubdate function=MyDate('Y-m-d',@me)/]</a></li>
  159.                                 <!--<li><a href="[field:arcurl/]"><span class="share"> </span>集团要闻</a></li>--------------------->
  160.                             </ul>
  161.                         </div>
  162.                     </div>
  163. {/dede:arclist}
  164. 显示自定义的arclist的字段,加channelid 加addfields字段
  165. {dede:arclist pagesize='12' typeid='10' channelid='2' addfields='wuxing,shuzi,ptitle,palt,tlink'}
  166. {/dede:arclist}
  167. <!---------------------分页显示新闻--------------------->
  168.  <div class="xinwen_box">
  169.                         {dede:list pagesize='6' titlelen='36'}
  170.                             <div class="lie-box">
  171.                                 <a href="[field:arcurl/]" >
  172.                                     <p class="xw-lt">
  173.                                         [field:title/]
  174.                                     </p>
  175.                                 </a>
  176.                             </div>
  177.                          {/dede:list}
  178.                             <div class="pages"> {dede:pagelist listitem="index,end,pre,next,pageno" listsize="7"/} </div>
  179.                         </div>
  180. <!---------------------{dede:global.cfg_sj/}显示系统的数据调用sysconfig表里的数据--------------------->
  181. <!---------------------sql语句调用数据--------------------->
  182. 查询栏目内容
  183. {dede:sql sql='Select content from "#@__arctype" where id=1'}
  184. [field:content/]
  185. {/dede:sql}
  186. 查询文章
  187. {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 "}
  188.      <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>
  189. {/dede:sql}
  190. 查询栏目
  191. {dede:sql sql="SELECT * From #@__arctype
  192. WHERE topid=1 And letter LIKE '%a%' or letter LIKE '%b' or letter LIKE '%c%' order by letter asc"}
  193.  <li><a href="[field:typedir function='str_replace("{cmspath}","",@me)'/]">[field:typename/]</a></li>
  194. {/dede:sql}
  195. <!---------------------根据typeid输出数据--------------------->
  196. {dede:type type="~typeid~"}[field:typename/]{/dede:type}
  197. <!---------------------设置[field:description/]的字数--------------------->
  198. [field:description function='cn_substr(Html2text("@me")."...",80)'/]
  199. <!---------------------当前位置--------------------->
  200. {dede:field name='position'/}
  201. 英文版
  202. {dede:field name='position'  function='str_replace("首页","Home",Html2Text("@me"))'/}
  203. <!---------------------调用共用页面--------------------->
  204. {dede:include filename="footer.htm"/}
  205. <!---------------------ShowMsg()跳转到哪个页面--------------------->
  206. <!---------------------文章详细页,输出图片集的所有图片--------------------->
  207. (输出所有)
  208. {dede:productimagelist}
  209.    <li class="now"> <a href="[field:imgsrc/]" target="_blank"><img longdesc="[field:imgsrc/]" src="[field:imgsrc/]" width="96" height="76"></a> </li>
  210. {/dede:productimagelist}
  211. (输出第一张)
  212. {dede:field name='imgurls' alt='图片输出区'}
  213.                   <a class="jqzoom" href="[field:imgsrc/]"> <img src="[field:imgsrc/]" alt="" class="js_goods_image_url" style="width: 520px;" /> </a>
  214.                   {/dede:field}
  215. <!---------------------热门标签--------------------->
  216. 参数说明:
  217. num:关键词数目
  218. subday:天数
  219. maxlength:关键词最大长度
  220. {dede:hotwords num='6' /}
  221. //页面输出内容:
  222. <a href='/plus/search.php?keyword=ibm'>ibm</a>
  223. <a href='/plus/search.php?keyword=htc'>htc</a>
  224. <a href='/plus/search.php?keyword=dedecms'>dedecms</a>
  225. <!---------------------搜索--------------------->
  226. <form  name="formsearch" action="{dede:global.cfg_cmsurl/}/plus/search.php" autocomplete="off">
  227.         <div class="form">
  228.           <h4>搜索</h4>
  229.            <input type="hidden" name="kwtype" value="0" />
  230.            <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='在这里搜索...';}" />
  231. <input type="text"  autocomplete="off" name="q" id="searchkey" placeholder="在这里搜索..."  maxlength="60" onfocus="if (value =='在这里搜索...'){value =''}"onblur="if (value ==''){value='在这里搜索...'}">
  232.            <select name="searchtype" class="search-option" id="search-option">
  233.                <option value="title" selected='1'>检索标题</option>
  234.                <option value="titlekeyword">智能模糊</option>
  235.            </select>
  236.           <button type="submit" class="search-submit">搜索</button>
  237.         </div>
  238.         </form>
  239. form禁止enter键提交最后面加上 onkeydown="if(event.keyCode==13)return false;"
  240. <form name="formsearch" action="{dede:global.cfg_cmsurl/}/plus/search.php"  onkeydown="if(event.keyCode==13)return false;">
  241. <form action="" autocomplete="off" method="post">//autocomplete="off"  清空数据
  242. echo "<script>alert('提交成功!'); window.history.go(-1)</script>";//返回当前页
  243. 15.指定id加class
  244. $(function(){
  245.             $("#7").addClass("active");
  246.         })
  247. <!---------------------文章详细页跳转到列表页--------------------->
  248. <a href="{dede:type typeid='0' row=1}[field:typelink function='str_replace("/index.html","",@me)' /]{/dede:type}" class="btn btn-default">全部</a>
  249. 17.当前是首页的话,导航栏首页高亮效果
  250. <li {dede:field name=typeid runphp="yes"}(@me=="")? @me="   class='on'  ":@me="";{/dede:field}>首页</li>
weinxin
我的微信
把最实用的经验,分享给最需要的读者,希望每一位来访的朋友都能有所收获!
avatar

Comment

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: