發表日期:2017-12 文章編輯:小燈 瀏覽次數:2684
我們在制作dedecms模板時,源代碼中的[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);
日期:2018-06 瀏覽次數:4010
日期:2019-09 瀏覽次數:5271
日期:2018-06 瀏覽次數:4300
日期:2018-06 瀏覽次數:4025
日期:2018-05 瀏覽次數:4274
日期:2018-05 瀏覽次數:4493
日期:2018-05 瀏覽次數:5148
日期:2018-05 瀏覽次數:3976
日期:2018-05 瀏覽次數:4152
日期:2018-05 瀏覽次數:4494
日期:2018-05 瀏覽次數:3446
日期:2018-03 瀏覽次數:3373
日期:2018-03 瀏覽次數:3498
日期:2018-01 瀏覽次數:3341
日期:2018-01 瀏覽次數:4051
日期:2018-01 瀏覽次數:3377
日期:2018-01 瀏覽次數:3182
日期:2017-12 瀏覽次數:3278
日期:2017-12 瀏覽次數:3537
日期:2017-12 瀏覽次數:3551
日期:2017-12 瀏覽次數:3108
日期:2017-12 瀏覽次數:3484
日期:2017-12 瀏覽次數:3215
日期:2017-12 瀏覽次數:3266
日期:2017-12 瀏覽次數:3162
日期:2017-12 瀏覽次數:3261
日期:2017-12 瀏覽次數:3209
日期:2017-12 瀏覽次數:3196
日期:2019-09 瀏覽次數:3175
日期:2017-12 瀏覽次數:3233
Copyright ? 2013-2018 Tadeng NetWork Technology Co., LTD. All Rights Reserved.