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

织梦channel属性currentstyle不好用怎么回事,第1张

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

我们在用织梦dedecms系统制作网站时,经常会用到channel标签来调子栏目。但是,很多朋友会遇到这种情况在使用channel标签来调子栏目的时候,指定 “type=son typeid=‘xx’” currentstyle竟然不好使。对于这个问题本站的出来方法是:


1、首先给出大家列出误认为正确的解决在top=‘son’ type=xx(指定ID)时候的channel属性currentstyle不好用的方法

代码如下:

  • {dede: type='son' typeid='12' currentstyle="
  • ~typename~
  • "}
  • [field:typename/]
  • {/dede:channel}

解决的办法:把typeid=‘12’改为channel=‘1’ (文章模型id),首页除外,其他页面不需要指定typeid=xx,会自动判断当前位置。

解决方法如下:

  • {dede: type='son' channel='1' currentstyle="
  • ~typename~
  • "}
  • [field:typename/]
  • {/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样式无效不起作用的问题。


欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/zaji/3007441.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-09-27
下一篇 2022-09-27

发表评论

登录后才能评论

评论列表(0条)

保存