DEDECMS自动编号(序号)autoindex属性

相关案例演示
让织梦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)?'':'style="display:none;"';{/dede:global} class="pd2_lmc_l1">
  
eg---->
  
{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}
  
{dede:channelartlist typeid="1" row="8" }
<div class="combz01" {dede:global name=itemindex runphp='yes'}if(@me==2)@me='id="with"';if(@me==5)@me='id="with"';if(@me==7)@me='id="with"';{/dede:global}>
<div class="combz01title"><a href="{dede:field name='typeurl'/}" title="{dede:field name='typename'/}" target="_blank"><b>{dede:field name='typename'/}</b></a><u><a href="{dede:field name='typeurl'/}" title="{dede:field name='typename'/}" target="_blank">更多>></a></u></div>
<div class="comcon">
{dede:arclist titlelen='42' row='1' flag='c'}
<img src="[field:litpic/]" width="127" height="94"/>
<i>[field:description function="cn_substr(@me,100)"/]...<a href="[field:arcurl /]" title="[field:fulltitle/]" target="_blank">[详情]</a></i>
{/dede:arclist}
</div>
<div class="comconlist">
<ul>
 {dede:arclist titlelen="42" row="3"}
 <li><a href="[field:arcurl /]">[field:title /]</a></li>
 {/dede:arclist}
</ul>
</div>
</div>
{/dede:channelartlist}
channel 标签下使用[field:global name=autoindex/]  
 
 
eg---->
 
{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/]
 
 
eg---->
 
{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}

免责声明:本站所有文章和图片均来自用户分享和网络收集,文章和图片版权归原作者及原出处所有,仅供学习与参考,请勿用于商业用途,如果损害了您的权利,请联系网站客服处理。


来源:网友投稿 关注: 时间:2020-03-31 08:57
首先声明,只要是我们的vip会员所有源码均可以免费下载,不做任何限制(了解更多)
☉本站的源码不会像其它下载站一样植入大量的广告。为了更好的用户体验以后坚持不打水印
☉本站只提供精品织梦源码,源码在于可用,不在多!!希望在这里找到你合适的。
☉本站提供的整站织梦程序,均带数据及演示地址。可以在任一源码详情页查看演示地址
☉本站所有资源(包括源码、模板、素材、特效等)仅供学习与参考,请勿用于商业用途。
☉如有其他问题,请加网站客服QQ进行交流。
相关织梦教程
QQ在线咨询