DedeCMS织梦

织梦Tag标签添加自增autoindex方法

阿里云

织梦 TAG 标签输出有时为了判断或者其他,我们需要获取它的自增数字,织梦 dede:tag 默认标签没有自增标签,我们可以自己添加
打开 /include/taglib/tag.lib.php 找到

  1. $ctp->LoadSource($InnerText);
也想出现在这里?联系我们
创客主机

在它下面加入

  1. $GLOBALS['autoindex'] = 1;

继续找到

  1. $revalue .= $ctp->GetResult();

在它下面加入

  1. $GLOBALS['autoindex']++;

标签写法:

  1. {dede:tag row='30' sort='new' getall='1'}
  2. <a href="[field:link/]" title="[field:tag/]" class="color_[field:global name=autoindex/]">[field:tag/]</a>
  3. {/dede:tag}

织梦 Tag 标签添加自增 autoindex 方法

已有 321 人购买
查看演示升级 VIP立刻购买

收藏
(1)

发表回复

热销模板

Ashade - 作品展示摄影相册WordPress汉化主题
LensNews

本站承接 WordPress / PbootCMS / DedeCMS 等
系统建站、仿站、开发、定制等业务!