Let Dedecms Autoindex,itemindex start from 0 to 1! Multi-style output (for reference)

Source: Internet
Author: User

Original website: http://my.oschina.net/lyx2012/blog/55888

[Field:global name=autoindex runphp= "yes"]@[email protected]+1; [/field:global]

{Dede:global Name=itemindex runphp= "yes"}@[email protected]+1; {/dede:global}


AutoIndex ItemIndex of the use of the difference of experience

Under the channelartlist tag, use {Dede:global name= ' itemindex ' runphp= ' yes ' @me; {/dede:global}

Self-increment 1


Arclist tag using [field:global.autoindex/] default starting from 1
Channel label using [field:global.autoindex/] default starting from 0
Using {dede:global.itemindex/} under the Channelartlist tab starts from 1 by default

Arclist starting from 0 [Field:global name=autoindex runphp= "yes"]@[email protected]; [/field:global]

Channel starting from 1 [field:global name=autoindex runphp= "yes"]@[email protected]+1; [/field:global] [field:typename/]

Channelartlist starting from 0 {dede:global name=itemindex runphp= ' yes '}@[email protected]; {/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 '}@[email protected];{ /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 ' > more >></a></u></div >
<div class= "Comcon" >
{dede:arclist titlelen= ' row= ' 1 ' flag= ' C '}

<i>[field:description function= "Cn_substr (@me, +)"/]...<a href= "[Field:arcurl/]" title= "[Field: fulltitle/] "target=" _blank ">[details]</a></i>
{/dede:arclist}
</div>
<div class= "Comconlist" >
<ul>
{dede:arclist titlelen= "row=" 3 "}
<li><a href= "[Field:arcurl/]" >[field:title/]</a></li>
{/dede:arclist}
</ul>
</div>
</div>
{/dede:channelartlist}


Using the channel label [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] >{/dede:channel}


This is the way to use AutoIndex runphp in arclist:

{dede:arclist titlelen= ' 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}

Self-increment 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" ></a></div>
</div>
{/dede:arclist}


How to define the starting number freely

Autoindex/itemindex can use @me +1; implementation starts with the specified number

Encounter similar problems to do this note, in the use of the time can be flexible to play!

Try AutoIndex under the List tab

{dede:list pagesize= ' orderby= ' ID '}

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

{/dede:list}

Let Dedecms Autoindex,itemindex start from 0 to 1! Multi-style output (for reference)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.