织梦栏目导航{dedechannel}标签添加序号教程
这样的序列在标签{dede:channel}中是无法调用
更多精彩就在: 51免费论文网|www.jxszl.com
的,所以必须修改标签,
默认的{dede:channel}调用方法:
{dede:channeltype=toprow=VIII}
{/dede:channel}
通过修改,改成下面的样式:
{dede:channeltype=toprow=VIIIline=II}
{/dede:channel}
修改步骤如下:
I..修改文件include/taglib/channel.lib.php,把
DEDE模板
$attlist="typeid|0,reid|0,row|I.00,col|I.,type|son,currentstyle|,cacheid|";
修改成
$attlist="typeid|0,reid|0,row|I.00,col|I.,type|son,currentstyle|,cacheid|,line|I.";//|后面的I.,代表初始值
第II.在第IX行附近追加如下代码:
//默认属性里设置的行数$default_line=$ctag->CAttribute->Items["line"];
第III.把下面代码
$row[sonids]=$row[rel]=;
修改成
$row[sonids]=$row[rel]=;$row[line]=$default_line+$i;
最后,特别要注意的是,如果要使用currentstyle样式,即当前栏目样式,则必修将刚才的"line"字段,追加到下面代码后面
$linkOkstr=str_replace("~rel~",$row[rel],$linkOkstr);$linkOkstr=str_replace("~id~",$row[id],$linkOkstr);$linkOkstr=str_replace("~typelink~",$row[typelink],$linkOkstr);$linkOkstr=str_replace("~typename~",$row[typename],$linkOkstr);$linkOkstr=str_replace("~line~",$row[line],$linkOkstr);
好了,以上就是怎么给织梦dedecms栏目导航{dede:channel}标签添加序号,希望对大家修改织梦dedecms有所帮助.
在DEDECMS中,我们会发现导航代码中有I.个[field:rel/],这个标签是导航栏中用来显示下级菜单栏目.
原文链接:http://www.jxszl.com/biancheng/dedecms/76327.html