Home > CMS Tutorial > DEDECMS > body text

How to set up the arclist loop of Dedecms to determine the first li, then add fixed css, otherwise not add it?

藏色散人
Release: 2019-12-18 09:21:29
Original
1996 people have browsed it

How to set up the arclist loop of Dedecms to determine the first li, then add fixed css, otherwise not add it?

How to set up the arclist loop of dedecms to determine the first li, then add fixed css, otherwise not add it?

This article mainly introduces the arclist loop of Dedecms. If it is judged to be the first li, then add fixed css, otherwise do not add it. It has certain reference value. If you are interested, Friends, you can refer to

Recommended learning: 梦Weavercms

In the arclist loop of dedecms, determine if it is the first li, then add fixed css, Otherwise,

is not added. After testing, the same applies to the channel tag.

Writing is as follows:

The code is as follows:

{dede:arclist row=4 flag=&#39;p&#39;} <li [field:global name=autoindex runphp="yes"](@me==1)? @me="class=on":@me="";
[/field:global]>[field:global.autoindex/]</li>{/dede:arclist}
 [field:global name=autoindex runphp="yes"](@me==1)? @me="class=on":@me="";[/field:global]
Copy after login

The meaning of this sentence is that if the loop is the first one, add class=on, otherwise it is empty .

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

Attached channel judgment case

{dede:channel type=&#39;son&#39; typeid=&#39;3&#39;}
<li [field:global name=autoindex runphp="yes"](@me==0)? @me="class=&#39;pro_lb on&#39;":@me="class=&#39;pro_lb&#39;";[/field:global]>[field:typename/]</li>
{/dede:channel}
Copy after login

The above is the detailed content of How to set up the arclist loop of Dedecms to determine the first li, then add fixed css, otherwise not add it?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!