织梦channel标签判断在第四个循环后增加图标

可以参考以下判断语句进行添加
[field:id runphp='yes'] if(@me=='4'){ @me="class='123'";} else {@me="";}[/field:id]  

以上代码意思为判断栏目ID为4时添加class="123"样式
然后在对class="123"做对应的样式进行调用即可
注:在你给出的代码中的<li>或<a>标签中添加,因为只给这么一段代码不能准确的给你答案,还需要针对你网站样式来定的,下边给你写出了使用方法,祝你成功
<li [field:id runphp='yes'] if(@me=='4'){ @me="class='123'";} else {@me="";}[/field:id]> <a [field:id runphp='yes'] if(@me=='4'){ @me="class='123'";} else {@me="";}[/field:id] href=http://www.dede58.com/"[field:typeurl/]" title="[field:typename/]" target="_blank">[field:typename/]</a>  

这是判断id为几的时候插入

如果想在第几个栏目的时候插入图片可以这样写

{dede:channel type='top' row='8' currentstyle=" <li><a href='~typelink~'>~typename~</a></li> "} <li><a href=http://www.dede58.com/"[field:typeurl/]" >[field:typename/]</a></li> [field:global runphp='yes' name=autoindex]if(@me=='3'){@me=" <li class='lh-logo'><a href='/'><img src='/skin/images/logo.png'/></a></li> ";} else {@me="";}[/field:global] {/dede:channel}  


[field:global runphp='yes' name=autoindex]if(@me=='3'){@me=" <li class='lh-logo'><a href='/'><img src='/skin/images/logo.png'/></a></li> ";} else {@me="";}[/field:global]  


这的意思就是在第四个栏目的时候插入一张图片,效果如图:

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/209b26f820d44c825253e56c73328af1.html