<var id="xvh3p"><noframes id="xvh3p"><var id="xvh3p"></var><listing id="xvh3p"><strike id="xvh3p"><listing id="xvh3p"></listing></strike></listing>
<var id="xvh3p"><strike id="xvh3p"><var id="xvh3p"></var></strike></var><th id="xvh3p"><strike id="xvh3p"><th id="xvh3p"></th></strike></th>
<span id="xvh3p"><noframes id="xvh3p"><dl id="xvh3p"></dl>
<span id="xvh3p"><noframes id="xvh3p">
<dl id="xvh3p"><noframes id="xvh3p">
<listing id="xvh3p"><noframes id="xvh3p"><listing id="xvh3p"><strike id="xvh3p"><listing id="xvh3p"></listing></strike></listing><th id="xvh3p"><strike id="xvh3p"><th id="xvh3p"></th></strike></th>
<th id="xvh3p"><strike id="xvh3p"></strike></th>
<dl id="xvh3p"><noframes id="xvh3p">
<th id="xvh3p"><noframes id="xvh3p">

观点

互联网+时代,说建站,谈运营与网络营销

dedecms的arclist或channel循环中判断第一个li添加css,否则不加

时间:2020-12-14

dedecms的arclist循环中,判断如果是第一个li,则添加固定的css,否则不加

经过dede58测试,同样在channel标签里也适用。
 
写法如下:
{dede:arclist row=4  flag='p'} 
 <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]

 

 
这句话的意思就是,如果循环出的是第一个,则添加class=on,否则为空。
 
注意:红色部分有两个等号。

channel的判断案例
{dede:channel type="son" typeid='23'}
 
<a href="[field:typeurl/]" [field:global name=autoindex runphp="yes"](@me==1)? @me="class=com_j hover":@me="class=com_j";[/field:global]>[field:typename/]</a>
 
{/dede:channel}
 
    0
    首页
    案例
    关于
    联系