织梦autoindex应用 dedecms循环中判断第几条数据

arclist 标签下使用 [field:global.autoindex/] 默认从1开始

 

{dede:arclist row='10' titlelen='48' typeid='1' channelid='1'}

从1开始:[field:global runphp='yes' name=autoindex][/field:global]或者[field:global.autoindex/]

从0开始:[field:global runphp='yes' name=autoindex]@me=@me-1;[/field:global]

{/dede:arclist}

 

channel 标签下使用 [field:global.autoindex/] 默认从0开始

{dede:channel row='5' type='top'}

从0开始:[field:global runphp='yes' name=autoindex][/field:global]或者[field:global.autoindex/]

从1开始:[field:global runphp='yes' name=autoindex]@me=@me+1;[/field:global]

{/dede:channel}

 

channelartlist 标签下使用 {dede:global.itemindex/} 默认从1开始

{dede:channelartlist row='4'}

从1开始:{dede:global name=itemindex runphp='yes'}{/dede:global}或者{dede:global.itemindex/}

从1开始:{dede:global name=itemindex runphp='yes'}@me=@me-1;{/dede:global}

{/dede:channelartlist}

 

list  到第10条时输出<br/>,否则输出空

循环到第几条加条线同理

{dede:list pagesize='40' orderby='id'} 

<li><a title="[field:title function='htmlspecialchars(@me)'/] " href="[field:arcurl /]">[field:title /]</a></li>

[field:global name='autoindex' runphp='yes']if(@me%10==0){@me="<br/>";}else{@me='';}[/field:global]  

{/dede:list}

转载于:https://www.cnblogs.com/bubuchu/p/8350520.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值