dedecms织梦channel标签判断在第四个循环后增加图标
发布时间:02/19 来源:未知 浏览:
关键词:
可以参考以下判断语句进行添加
1 |
[field: id runphp= 'yes' ] if (@me== '4' ){ @me= "class='123'" ;} else {@me= "" ;}[/field: id ] |
|
以上代码意思为判断栏目ID为4时添加class="123"样式
然后在对class="123"做对应的样式进行调用即可
注:在你给出的代码中的<li>或<a>标签中添加,因为只给这么一段代码不能准确的给你答案,还需要针对你网站样式来定的,下边给你写出了使用方法,祝你成功
1 |
<li [field: id runphp= 'yes' ] if (@me== '4' ){ @me= "class='123'" ;} else {@me= "" ;}[/field: id ]> |
2 |
<a [field: id runphp= 'yes' ] if (@me== '4' ){ @me= "class='123'" ;} else {@me= "" ;}[/field: id ] href= "[field:typeurl/]" title= "[field:typename/]" target= "_blank" >[field:typename/]</a> |
|
这是判断id为几的时候插入
如果想在第几个栏目的时候插入图片可以这样写
1 |
{dede:channel type = 'top' row= '8' currentstyle=" |
2 |
<li><a href= '~typelink~' >~typename~</a></li> |
4 |
<li><a href= "[field:typeurl/]" >[field:typename/]</a></li> |
5 |
[field:global runphp= 'yes' name=autoindex] if (@me== '3' ){@me=" |
6 |
<li class= 'lh-logo' ><a href= '/' ><img src= '/skin/images/logo.png' /></a></li> |
7 |
";} else {@me=" ";}[/field:global] |
|
1 |
[field:global runphp= 'yes' name=autoindex] if (@me== '3' ){@me=" |
2 |
<li class= 'lh-logo' ><a href= '/' ><img src= '/skin/images/logo.png' /></a></li> |
3 |
";} else {@me=" ";}[/field:global] |
|
这的意思就是在第四个栏目的时候插入一张图片,效果如图:
打赏
打赏
扫码打赏,你说多少就多少
打开支付宝扫一扫,即可进行扫码打赏哦
百分百源码网 建议打赏1~10元,土豪随意,感谢您的阅读!