DEDECMS自動(dòng)編號(hào)(序號(hào))autoindex屬性
時(shí)間: 2020-04-02 13:27
閱讀: 次
作者:素材無(wú)憂網(wǎng)
讓織夢(mèng)dedecms autoindex,itemindex 從0到1開(kāi)始的辦法!
[field:global name=autoindex runphp="yes"]@me=@me+1;[/field:global]
{dede:global name=itemindex runphp="yes"}@me=@me+1;{/dede:global}
autoindex itemindex 的使用心得區(qū)別
channelartlist 標(biāo)簽下使用
{dede:global name='itemindex' runphp='yes'}@me;{/dede:global}
自增1
arclist 標(biāo)簽下使用 [field:global.autoindex/] 默認(rèn)從1開(kāi)始
channel 標(biāo)簽下使用 [field:global.autoindex/] 默認(rèn)從0開(kāi)
channelartlist 標(biāo)簽下使用 {dede:global.itemindex/} 默認(rèn)從1開(kāi)始
arclist 從0開(kāi)始 [field:global name=autoindex runphp="yes"]@me=@me-1;[/field:global]
channel 從1開(kāi)始 [field:global name=autoindex runphp="yes"]@me=@me+1;[/field:global][field:typename/]
channelartlist 從0開(kāi)始 {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 標(biāo)簽下使用[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 時(shí)用這種方式:
{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}
標(biāo)簽: