织梦一二级导航菜单被点击的栏目高亮显示方法详解,废话不多说直接举例说明: 织梦一级菜单被点击栏目高亮调用方法: HTML {dede:channel typeid =1 type =son currentstyle= li class = on a href = ~typelink~ […]
{dede:channel typeid ='1' type ='son' currentstyle="<li class='on'><a href='~typelink~'>~typename~</a></li>"}
<li><a href='[field:typeurl/]'>[field:typename/]</a></li>
{/dede:channel}
<li><a {dede:field name=typeid runphp="yes"}(@me=="")? @me=" class='on'":@me="";{/dede:field} href="{dede:global.cfg_basehost/}">网站首页</a></li>
1:打开include aglibchannelartlist.lib.php,找到
$pv->Fields['typeurl'] = GetOneTypeUrlA($typeids[$i]);
$pv->Fields['typeurl'] = GetOneTypeUrlA($typeids[$i]);
if($typeids[$i]['id'] == $refObj->TypeLink->TypeInfos['id'] || $typeids[$i]['id'] == $refObj->TypeLink->TypeInfos['topid'] ){
$pv->Fields['currentstyle'] = $currentstyle ? $currentstyle : 'navOn';
}
else{
$pv->Fields['currentstyle'] = '';
}
{dede:channelartlist typeid='top' currentstyle='on' }
<li><a class="{dede:field.currentstyle/}" href="{dede:field name='none'/}" >{dede:field name='typename'/}</a>
<ul>{dede:channel type='son' noself='yes'}
<li><a href="[field:typelink/]" >[field:typename/]</a></li>
{/dede:channel}
</ul>
</li>
{/dede:channelartlist}