dedecms织梦cms目录页隔行换款式方式小结

2021-03-27 03:11 jianzhan
div[field:global function=MagicVar("style1","style2")/] ahref="[field:arcurl/]" [field:title/] /a /div

每过二行輸出消除款式

 {dede:channel type='son' typeid='1'}
 li a href='[field:typeurl/]' [field:typename/] /a /li 
 [field:global name=autoindex runphp="yes"]
 if(@me%2==0)@me=" div /div 
 else @me="";
 [/field:global]
 {/dede:channel}
 /ul 

假如应用channel弄隔行换色,必须自增从1刚开始,精减书写以下:
 

 div 
 {dede:channel row=6 typeid=''}
 [field:global name=autoindex runphp="yes"]((@me+1) % 2 == 0)?@me=" li ":@me=" li [/field:global]
 h4 [field:title/] /h4 
 /li 
 {/dede:channel}
 /ul 
 /div