dede标签之栏目标签的运用

dede顶级栏目获取

  1. {dede:channel row="10" type="top" col="1" currentstyle="<li class='hover'><a href='~typelink~' ~rel~><span>~typename~</span></a></li>" }
  2. <li><a href='[field:typeurl/]' [field:rel/]><span>[field:typename/]</span></a></li>
  3. {/dede:channel}

dede同级栏目获取

  1. {dede:channel row="10" type="self" col="1" currentstyle="<li class='hover'><a href='~typelink~' ~rel~><span>~typename~</span></a></li>" }
  2. <li><a href='[field:typeurl/]' [field:rel/]><span>[field:typename/]</span></a></li>
  3. {/dede:channel}

dede下级栏目获取

  1. {dede:channel row="10" type="son" col="1" currentstyle="<li class='hover'><a href='~typelink~' ~rel~><span>~typename~</span></a></li>" }
  2. <li><a href='[field:typeurl/]' [field:rel/]><span>[field:typename/]</span></a></li>
  3. {/dede:channel}

在当前栏目下获取到下级栏目,如在其他栏目则需要对增加 typeid='1',1为栏目的ID

当前栏目高亮

  1. currentstyle="<li class='hover'><a href='~typelink~' ~rel~><span>~typename~</span></a></li>"
  1. <style type="text/css">
  2.   .hover{
  3.     padding-bottom5px;
  4.     border-bottom2px solid #961111;
  5.   }
  6. </style>

此样式为随便写的,仅供参考

 

指定栏目调用

  1. {dede:type typeid='1'}
  2. <a href="[field:typelink /]">[field:typename /]</a>
  3. {/dede:type}
李金龙

发表评论

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