|
织梦的channel 频道标签currentstyle可用于type=top或self兄弟分类上,没法用于子分类.
基本语法:
{dede:channel type='top' row='8' currentstyle="[*,[url=~typelink~,~typename~[/url] "}
[*,[url=[field:typelink/,,[field:typename/,[/url]
{/dede:channel}
想让子分类也实现当前栏目高亮显示,只能手工列出所有类目.然后根据field;ID来判断.举例.比如下实现下面的侧边导航,其中,2,3,15分类为父类目.其它为子分类.代码如下
css如下:
.submenu a{padding:10px 20px;text-decoration:none;}
.submenu li ul {display:none;}
.submenu >li>a {font-weight:bold!important;}
.active2 a{color:#e33;text-decoration:none;}
.active3 >a{color:#e33;text-decoration:none;}
html代码如下:
Product classification
{dede:type typeid=2}[url=, [field:typename /,{/dede:type}[/url]
{dede:type typeid=8}
ref="[field:typelink /,"> [field:typename /,{/dede:type}
{dede:type typeid=9}
ref="[field:typelink /,"> [field:typename /,{/dede:type}
{dede:type typeid=3}[url=, [field:typename /,{/dede:type}[/url]
{dede:type typeid=4}
ref="[field:typelink /,"> [field:typename /,{/dede:type}
{dede:type typeid=5}
ref="[field:typelink /,"> [field:typename /,{/dede:type}
{dede:type typeid=15}[url=, [field:typename /,{/dede:type}[/url]
{dede:type typeid=16}
ref="[field:typelink /,"> [field:typename /,{/dede:type}
|
|