找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 1117|回复: 0

[分享] 织梦autoindex的用法大全,在各个标签中运用

[复制链接]
发表于 2018-7-20 07:03:52 | 显示全部楼层 |阅读模式 来自 河南省新乡市
下面来说一个在织梦dedecms列表页我们可以使用autoindex和itemindex来实现多种样式的用法

大家在使用autoindex的时候有时候从1开始,有时候从0开是,下面介绍下什么情况下从0,1开始:

autoindex/itemindex 可以使用 @me+1;  更改数字自由定义开始的数字  不懂往下看



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



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

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

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

  4. {/dede:arclist}
复制代码




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

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

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

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

  4. {/dede:channel}
复制代码




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

  1. {dede:channelartlist row='4'}

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

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

  4. {/dede:channelartlist}
复制代码




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

循环到第几条加条线同理

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

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

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

  4. {/dede:list}
复制代码

发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;

如何回报帮助你解决问题的坛友,好办法就是点击帖子下方的评分按钮给对方加【金币】不会扣除自己的积分,做一个热心并受欢迎的人!

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

本版积分规则 需要先绑定手机号

关闭

站长推荐上一条 /1 下一条

QQ|侵权投诉|广告报价|手机版|小黑屋|西部数码代理|飘仙建站论坛 ( 豫ICP备2022021143号-1 )

GMT+8, 2024-5-11 18:58 , Processed in 0.037357 second(s), 8 queries , Redis On.

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表