织梦dedecms首页导航栏currentstyle参数无效的替代方 -电脑资料

电脑资料 时间:2019-01-01 我要投稿
【www.unjs.com - 电脑资料】

    这篇文章主要介绍了织梦dedecms首页导航栏currentstyle参数无效的替代方法,currentstyle参数无效会导致导航栏不能高亮,本文就给出了另一种解决方法,需要的朋友可以参考下

    默认织梦的首页没有设置高亮属性,只要其他栏目可以,

织梦dedecms首页导航栏currentstyle参数无效的替代方

。以下代码可以解决这个问题:

代码如下:

   

    (@me=="")? @me=" class=‘hover‘":@me="";{/dede:field}>

    主页

    {dede:channel type=‘top‘ row=‘10‘ currentstyle="

  •     ~typename~

    "}

       

    [field:typename/]

        {/dede:channel}

        以上蓝色加粗的代码就是判断当前栏目是否是首页,如果是首页则加上class=‘hover‘,否则就不加,以此来达到想要的效果,

    电脑资料

    织梦dedecms首页导航栏currentstyle参数无效的替代方》(https://www.unjs.com)。

  • 最新文章