Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Introduction to the usage of autoindex and itemindex in DedeCms

2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

In this article, we will take a look at the usage of autoindex and itemindex in DedeCms. There is a certain reference value, friends in need can refer to, hope to help you.

Autoindex/itemindex can use the @ me+1; implementation to start with a specified number.

The code is as follows:

The way to get dedecms autoindex,itemindex to start from 0 to 1

The code is as follows:

[field:global name=autoindex runphp= "yes"] @ me=@me+1; [/ field:global] {dede:global name=itemindex runphp= "yes"} @ me=@me+1; {/ dede:global}

The difference of experience in using autoindex itemindex

Use {dede:global name='itemindex' runphp='yes'} @ me; {/ dede:global} under the channelartlist tag

Self-increasing 1

Use [field:global.autoindex/] default from 1 under arclist tag [field:global.autoindex/] default from 0 under channelartlist tag using {dede:global.itemindex/} default arclist starts from 1 [field:global name=autoindex runphp= "yes"] @ me=@me-1; [/ field:global] channel starts from 1 [field:global name=autoindex runphp= "yes"] @ me=@me+1 [/ field:global] [field:typename/] channelartlist starts at 0 {dede:global name=itemindex runphp='yes'} @ me=@me-1; {/ dede:global}

Channelartlist instance

The code is as follows:

{dede:channelartlist notypeid='123124146147'} {dede:php} if ($refObj- > Fields ['ispart']) {echo $refObj- > Fields [' typename'];} {/ dede:php} {/ dede:channelartlist}

Use [field:global name=autoindex/] under the label

Channel instance

The code is as follows:

{dede:channel titlelen='32'} [field:typename/] {/ dede:channel}

Use autoindex runphp in arclist in this way:

The code is as follows:

{dede:arclist titlelen='22' row='4' flag='c' orderby='id'} [field:title /] [field:global name='autoindex' runphp='yes'] if (@ me==2) {@ me= ";} else {@ me='';} [/ field:global] {/ dede:arclist}

Self-increasing 1

[field:global.autoindex/]

Arclist instance

The code is as follows:

{dede:arclist channelid=17 row=6 orderby=pubdate titlelen=40 addfields='docphoto,docjob,doctec'typeid='123136146155172182202'}

[field:fulltitle/]

{/ dede:arclist}

How to freely define the starting number

Autoindex/itemindex can use @ me+1; implementation to start with a specified number

Take this note when you encounter similar problems, and you can play flexibly when you use it!

Try autoindex under the list tag

The code is as follows:

{dede:list pagesize='40' orderby='id'} [field:global name='autoindex' runphp='yes'] if (@ me==0) {@ me= "test";} else {@ me='';} [/ field:global] {/ dede:list}

Use custom functions with autoindex/itemindex

First add a custom function to include/extend.fun.php

The code is as follows:

Function MyPosition ($p) {$positionArr=array (275330380435495547); return $positionArr [$p]

Then add it to the template

The code is as follows:

{dede:channel type='son' typeid='13' row='6' noself='yes'} [field:typename/] {/ dede:channel} the above is a brief introduction to the use of autoindex and itemindex in DedeCms. Of course, the differences in the detailed use of the above have to be understood by everyone. If you want to know more, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report