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

{dede:type=sontyp" />

"景先生毕设|www.jxszl.com

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

2022-10-29 16:26编辑: www.jxszl.com景先生毕设
我们在用织梦dedecms系统制作网站时,经常会用到channel标签来调子栏目.但是,很多朋友会遇到这种情况在使用channel标签来调子栏目的时候,指定type=sontypeid=‘xx’"currentstyle竟然不好使.对于这个问题本站的出来方法是:


I..首

 更多精彩就在: 51免费论文网|www.jxszl.com 
先给出大家列出误认为正确的解决在top=‘son’type=xx(指定ID)时候的channel属性currentstyle不好用的方法
代码如下:

{dede:type=sontypeid=I.IIcurrentstyle="
  • ~typename~
  • "}
  • [field:typename/]

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

    解决方法如下:

    {dede:type=sonchannel=I.currentstyle="
  • ~typename~
  • "}
  • [field:typename/]

  • {/dede:channel}
    我经过经测试这种在top=‘son’type=xx(指定ID)时候的调用方式currentstyle根本不好用,简直是扯淡.

    II.解决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样式无效不起作用的问题.


    原文链接:http://www.jxszl.com/biancheng/dedecms/74834.html