• 全国400电话网上服务平台
    强大号码库资源任选,方便,快捷,快速开通。
    咨询热线:400-1100-266  

    DedeCms织梦模板 autoindex和itemindex 使用教程
    POST TIME:2021-05-23 02:16
    让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}
     
     
    <div id="h_pd_lm_{dede:global.itemindex/}" {dede:global name='itemindex' runphp='yes'}@me=(@me==1)?'':'';{/dede:global} class="pd2_lmc_l1">
     
     
    channelartlist实例
    {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='';}[/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}
    
    关于我们 | 付款方式 | 建站知识 | 增值服务 | 网站模板
    Copyright © 2003-2016
    时间:9:00-21:00 (节假日不休)
    版权所有:巨人网络(扬州)科技有限公司
    总部地址:江苏省信息产业基地11号楼四层
    《增值电信业务经营许可证》 苏B2-20120278
    X

    截屏,微信识别二维码

    微信号:veteran88

    (点击微信号复制,添加好友)

     打开微信

    微信号已复制,请打开微信添加咨询详情!