How to change the color of dede dreamweaver article list every other row
dedeHow to change the color of the dreamweaver article list?
Let me share with you a piece of code that can make the dreamweaver article list The background of the article list achieves the interlaced color changing effect: the specific code is as follows, you can modify it according to your own needs:
Recommended learning: 梦Weavercms
The sample code is as follows:
{dede:arclist row='12' titlelen='33' typeid='1' orderby ='pubdate'} [field:global runphp='yes' name=autoindex] $adminbuy.cn_a="<li class='adminbuy.cn_c'>"; $adminbuy.cn_b="<li class=''adminbuy.cn_d'>"; if ((@me%2)==0) @me=$'adminbuy.cn_a; else @me=$'adminbuy.cn_b; [/field:global] <a href='[field:arcurl/]'>[field:title/]</a> </li> {/dede:arclist}
It can be seen from the above example:
This code uses autoindex auto-increment, and the auto-increment number is modulo 2. When the auto-increment number %2==0, that is to say When the self-increasing number is divisible by 2, it is true and outputs $'adminbuy.cn_a. The code at this time is:
{dede:arclist row='12' titlelen='33' typeid='1' orderby ='pubdate'} <li class=''adminbuy.cn_c'><a href='[field:arcurl/]'>[field:title/]</a></li> {/dede:arclist}
When it is not divisible by 2, it is false and outputs $'adminbuy.cn_b. At this time, The code is:
{dede:arclist row='12' titlelen='33' typeid='1' orderby ='pubdate'} <li class=''adminbuy.cn_d'><a href='[field:arcurl/]'>[field:title/]</a></li> {/dede:arclist}
By outputting different class styles in the li tag (two styles, 2l3.net_c and 2l3.net.com_d, need to be defined in the css), the interlaced color can be changed.
Through the analysis of this code, we can also expand our ideas. Is it possible to add an underline every two lines?
{dede:arclist row='12' titlelen='33' typeid='1' orderby ='pubdate'} <li><a href='[field:arcurl/]'>[field:title/]</a></li> [field:global runphp='yes' name=autoindex] if(@me%2==0)@me="<hr />"; else @me=""; [/field:global] {/dede:arclist}
After testing, the above can indeed add an underline every 2 lines.
The above is the detailed content of How to change the color of dede dreamweaver article list every other row. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)
