muban大师 发表于 2020-3-12 10:47:27

织梦channel属性currentstyle不好用怎么回事

我们在用织梦dedecms系统制作网站时,经常会用到channel标签来调子栏目。但是,很多朋友会遇到这种情况在使用channel标签来调子栏目的时候,指定 “type=son typeid=‘xx’” currentstyle竟然不好使。对于这个问题本站的出来方法是:
       
       
        1、首先给出大家列出误认为正确的解决在top=‘son’ type=xx(指定ID)时候的channel属性currentstyle不好用的方法
        代码如下:
       
        {dede: type='son' typeid='12' currentstyle="[*, "}
        [*,
        {/dede:channel}
        解决的办法:把typeid=‘12’改为channel=‘1’ (文章模型id),首页除外,其他页面不需要指定typeid=xx,会自动判断当前位置。
       
        解决方法如下:
       
        {dede: type='son' channel='1' currentstyle="[*, "}
        [*,
        {/dede:channel}
        我经过经测试这种在top=‘son’ type=xx(指定ID)时候的调用方式currentstyle根本不好用,简直是扯淡。
       
        2、解决channel属性currentstyle在top=‘son’ type=xx(指定ID)时候不好用的正确方法
        修改include/taglib/channel.lib.php
        把
        if( ($row['id',==$typeid || ($topid==$row['id', && $type=='top') ) && $currentstyle!='' )
        改成
        if( ( $row['id',== $refObj->TypeLink->TypeInfos['id', || ($topid==$row['id', && $type=='top') ) && $currentstyle!='' )
        我经测试这种调用方式currentstyle有效,可以解决在top=‘son’ type=xx(指定ID)时候channel标签currentstyle样式无效不起作用的问题。
页: [1]
查看完整版本: 织梦channel属性currentstyle不好用怎么回事