仿站咨询QQ:2587483189

手机微信同号:15850888840

栏目列表常见序号调用

做很多JS效果时经常要用到[field:global name=autoindex/]标签,此标签最简单的用法就是按内容条数来获取数字序号,但有的时候发现使用该标签时无效比如频道页。

 

channelartlist标签下可以使用{dede:global name='itemindex'/}

dede:channel标签下直接使用[field:global name=autoindex/]

dede:channel标签当前样式currentstyle下时,需要修改文件,channel.lib.php文件,就可以使用~autoindex~ 来调用了

                    $linkOkstr = $currentstyle;
                    $row['typelink'] = GetOneTypeUrlA($row);
                    $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("~autoindex~",$GLOBALS['autoindex']+1,$linkOkstr);

  • 上一篇:dedecms自定义表单加入验证码
  • 下一篇:当没有子栏目时显示同级栏目 关闭该功能解决方法
  • 来源:未知//所属分类: dede仿站 /更新时间:2012-06-27
    相关仿站教程