Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to set the arclist loop of dream weaving dedecms to determine the first li, then add a fixed css, otherwise do not add

Shulou Source: shulou.com Published: 2022-06-02 03:34:21 11月15日 Update

Editor to share with you how to set up the dream weaving dedecms arclist cycle to judge the first li, then add a fixed css otherwise do not add, I believe most people do not understand, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!

How to set the arclist loop of Weaving Dream dedecms to judge the first li, then add a fixed css or not?

In the arclist loop of dedecms, it is judged that if it is the first li, add a fixed css, otherwise do not add

After testing, it is also applicable in the channel tag.

It is written as follows:

The code is as follows:

{dede:arclist row=4 flag='p'} [field:global.autoindex/] {/ dede:arclist} [field:global name=autoindex runphp= "yes"] (@ me==1)? @ me= "class=on": @ me= ""; [/ field:global]

This sentence means that if the loop is the first, class=on is added, otherwise it is empty.

Note: there are two equal signs in the red part.

The judgment case of attached channel

{dede:channel type='son' typeid='3'} [field:typename/] {/ dede:channel} how to set up the arclist loop of dream weaving dedecms to judge the first li, then add a fixed css, otherwise do not add all the content, thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Tags: Loop content article not much two code writing most that is meaning more tags cases knowledge equal sign red industry information information channels this sentence Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno NVidia vpn Microsoft Linux MySQL