DedeCMS中channelartlist自增参数global.itemindex
在 dede:channelartlist 标签下,使用:
{dede:global.itemindex runphp='yes'} {/dede:global.itemindex}
dede:channel标签下,使用:
[field:global name=autoindex runphp="yes"][/field:global][field:typename/]
从网上查到更详细的使用说明:
让dedecms autoindex,itemindex 从0到1开始的办法
[field:global name=autoindex runphp="yes"]@me=@me+1;[/field:global]
{dede:global name=itemindex runphp="yes"}@me=@me+1;{/dede:global}
autoindex itemindex 的使用心得区别
channelartlist 标签下使用
{dede:global name='itemindex' runphp='yes'}@me;{/dede:global}
自增1
arclist 标签下使用 [field:global.autoindex/] 默认从1开始
channel 标签下使用 [field:global.autoindex/] 默认从0开始
channelartlist 标签下使用 {dede:global.itemindex/} 默认从1开始
arclist 从0开始
[field:global name=autoindex runphp="yes"]@me=@me-1;[/field:global]
channel 从1开始
[field:global name=autoindex runphp="yes"]@me=@me+1;[/field:global][field:typename/]
channelartlist 从0开始{dede:global name=itemindex runphp=’yes’}@me=@me-1;{/dede:global}
{dede:channelartlist notypeid='123,124,146,147'}
<a class="pd2_lmt{dede:global name=itemindex runphp='yes'}@me=(@me==1)?'1':'3';{/dede:global}" onmouseover="showitem2({dede:global name=itemindex runphp='yes'}@me=@me-1;{/dede:global},'pd_lm','h_pd_lm_','pd2_lmt');" href='{dede:field name='typeurl'/}'>
{dede:php}if($refObj->Fields['ispart']){echo $refObj->Fields['typename'];}{/dede:php}
</a>
{/dede:channelartlist}
标签下使用 [field:global name=autoindex/]
channel实例
{dede:channel titlelen='32'}
<li [field:global name='autoindex' runphp='yes']if(@me%2==0){@me='class="rr"';}else{@me='';}[/field:global] ><h3><a href='[field:typelink/]'>[field:typename/]</a></h3></li>
{/dede:channel}
在arclist中使用autoindex runphp 时用这种方式:
{dede:arclist titlelen='22' row='4' flag='c' orderby='id'}
<a href="[field:arcurl /]" target="_blank">[field:title /]</a>
[field:global name='autoindex' runphp='yes']if(@me==2){@me="<br />";}else{@me=' ';}[/field:global]{/dede:arclist}
自增1
[field:global.autoindex/]
arclist实例
{dede:arclist channelid=17 row=6 orderby=pubdate titlelen=40 addfields='docphoto,docjob,doctec' typeid='123,136,146,155,172,182,202'}
<div id="h_nrr_zj_[field:global.autoindex/]" class="nrr_zjl" [field:global name='autoindex' runphp='yes']if(@me==1){@me="";}else{@me='style="display:none;"';}[/field:global] >
<div><a href="[field:arcurl/]" title="[field:fulltitle/]" target="_blank"><img src="[field:litpic/]" alt="[field:fulltitle/]" /></a></div>
</div>
{/dede:arclist}
如何自由定义 开始的数字
autoindex/itemindex 可以使用 @me+1;实现由指定数字开始
遇到类似的问题做下这个笔记,在用到的时候可以灵活发挥!
list 标签下试用autoindex
{dede:list pagesize='40' orderby='id'}
[field:global name='autoindex' runphp='yes']if(@me%10==0){@me="test";}else{@me='';}[/field:global]
{/dede:list}
文章来源:https://blog.csdn.net/langyu1021/article/details/78039962
DedeCMS中channelartlist自增参数global.itemindex的更多相关文章
- python3中的缺省参数和global
关于py中缺省参数: 在声明函数的时候对某些参数(一个或多个)进行赋值,在你调用的时候无需在实参列表中体现该参数,但是在执行的时候会默认加上这个已经在形参中定义好的参数. 但是,缺省参数必须放在最后, ...
- C# 动态生成word文档 [C#学习笔记3]关于Main(string[ ] args)中args命令行参数 实现DataTables搜索框查询结果高亮显示 二维码神器QRCoder Asp.net MVC 中 CodeFirst 开发模式实例
C# 动态生成word文档 本文以一个简单的小例子,简述利用C#语言开发word表格相关的知识,仅供学习分享使用,如有不足之处,还请指正. 在工程中引用word的动态库 在项目中,点击项目名称右键-- ...
- Webform(五)——内置对象(Response、Request)和Repeater中的数据增删改
一.内置对象 (一)Response对象 1.简介:response 对象在ASP中负责将信息传递给用户.Response对象用于动态响应客户端请求,并将动态生成的响应结果返回到客户端浏览器中,使用R ...
- DEDECMS中,自增长标签
自增长 arclist 标签下使用 [field:global.autoindex/] 默认从1开始 channel 标签下使用 [field:global.autoindex/] 默认从0开始 ch ...
- Android(java)学习笔记186:对ListView等列表组件中数据进行增、删、改操作
1.ListView介绍 解决大量的相似的数据显示问题 采用了MVC模式: M: model (数据模型) V: view (显示的视图) C: controller 控制器 入门案例: acit ...
- 织梦 dedecms 中LOOP 万能标签循环 调用 arcurl标签(获取链接)
在DEDECMS中,提供了loop万能循环标签,但是此循环标签只能循环出该表中的字段,而“[field:arcurl/]”链接标签并不能被解析出来,而DEDECMS官方论坛上也没有找到相关的解决办法, ...
- (转) dedecms中自定义数据模型
刚学习完dedecms的标签语法,我有很多困惑,觉得标签的意义比较抽象,不知道如何用标签来写一些具体的内容.如果有一些数据库的编程经验,就知道一个很常用的编程范例—增删改查.比如说,我要建立的是书本的 ...
- Direcshow中视频捕捉和参数设置报告
Direcshow中视频捕捉和参数设置报告 1. 关于视频捕捉(About Video Capture in Dshow) 1视频捕捉Graph的构建 一个能够捕捉音频或者视频的graph图 ...
- jquery中的ajax方法参数
引用来自:http://www.cnblogs.com/tylerdonet/p/3520862.html jquery中的ajax方法参数总是记不住,这里记录一下. 1.url: 要求为String ...
随机推荐
- 2016年3月8日Android实习日记
1.出现fragment后台栈的bug. bug描述:当点击加入后台栈的操作按钮改变指定控件的内容之后,称为A操作:接下来又点击其它没有操作后台栈的按钮来修改原来指定的控件内容,称为B操作.然后点击b ...
- Git Windows 安装
环境 Windows版本:Windows 7 旗舰版 处理器:Inte i5 系统类型:64 位操作系统 下载 Git Windows https://github.com/git-for-windo ...
- unity小知识了解
在搜索栏的右侧有三个按钮,单击第一个按钮,弹出相应菜单,可以根据目标类型过滤搜索结果.[按钮从左到右] 第二个按钮,提供素材标签来过滤搜索结果,可以自定义标签. 第三个按钮,提供了将搜索结果添加到前面 ...
- C++构造函数初始化列表与构造函数中的赋值的区别
C++类中成员变量的初始化有两种方式:构造函数初始化列表和构造函数体内赋值. 一.内部数据类型(char,int……指针等) class Animal { public: Animal(int wei ...
- pycharm如何设置python版本、设置国内pip镜像、添加第三方类库
直接上图(mac环境): 一.设置项目的python版本 File->Default Settings ... 在弹出的界面上(参考下图),左上角的下拉框里,选择python解释器的版本即可(建 ...
- 在Windows环境下使用docker
Widows下的Docker工具有两个:Docker Toolbox,和Docker Desktop,其中后者是在win10下才能使用的,提供了更强大的功能.由于我个人的电脑是win7环境,用的就是d ...
- Autonomous driving - Car detection YOLO
Andrew Ng deeplearning courese-4:Convolutional Neural Network Convolutional Neural Networks: Step by ...
- ubuntu crontab 在时间段内随机执行一次
crontab 在linux下做定时任务的命令, 1. 基本格式 * * * * * cmd 第一个表示:分钟 1-59, 每分钟用 */1 第二个表示:小时 023 第三个表示:日期1-31 第四个 ...
- angularjs drag and drop
angular-dragula Drag and drop so simple it hurts 480 live demo angular-drag-and-drop-lists Angular d ...
- 1.5.3 GROUP BY子句
1.5.3 GROUP BY子句正在更新内容.请稍后