[织梦CMS教程] 织梦在channel标签的数字递增调用方法

[复制链接]
查看1196 | 回复7 | 2019-7-13 06:15:42 | 显示全部楼层 |阅读模式
我们知道文章调用支持autoindex 但channel 不支持,那如何支持呢?   在include/taglib/channel.lib.php 第140行即是
$linkOkstr = str_replace("~typename~",$row['typename'],$linkOkstr);

之后加一句
 
$linkOkstr = str_replace("~autoindex~",$GLOBALS['autoindex'],$linkOkstr);
  下面是例句:
{dede:channel type='top' currentstyle="<li  id='taba~autoindex~' class='top1'><a href='~typelink~'>~typename~</a></li>" }
         <li  id='taba[field:global.autoindex/]'><a href='[field:typelink/]'>[field:typename/]</a></li> 
{/dede:channel}

从1开始标签:
[field:autoindex runphp='yes']@me=$GLOBALS['autoindex']+0;[/field:autoindex]
 
$GLOBALS['autoindex'] = 0;
这是织梦默认从0开始,如果要从1开始可以把0改成1,就是
$GLOBALS['autoindex'] = 1;

 
回复

使用道具 举报

caymkda949764 | 2022-2-18 19:59:20 | 显示全部楼层
资源太多了,准备办个会员
回复

使用道具 举报

陈辞滥调 | 2022-6-2 04:11:39 | 显示全部楼层
我是来白嫖资源的!
回复

使用道具 举报

或许你会吞 | 2023-1-30 05:01:01 | 显示全部楼层
支持悟空源码,越来越好
回复

使用道具 举报

dgx3529361 | 2023-2-14 18:42:26 | 显示全部楼层
很不错的资源站
回复

使用道具 举报

是鹅好甜 | 2023-4-1 19:04:46 | 显示全部楼层
没积分哈,谁来帮帮我啊
回复

使用道具 举报

没想爱上你堑 | 2023-12-26 00:58:08 | 显示全部楼层
悟空源码资源不错。粉了
回复

使用道具 举报

123457557 | 2024-3-20 19:35:40 | 显示全部楼层
很不错的资源站
回复

使用道具 举报

一心之恋祭 | 2024-6-20 22:21:25 | 显示全部楼层
祝愿悟空源码越办越好!
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则