首页 > 网站 > 建站经验 > 正文

dedecms循环栏目时使用不同样式的方法

2024-04-25 20:49:00
字体:
来源:转载
供稿:网友

{dede:channelartlist}                                
            [field:global name=autoindex runphp="yes"](@me%2==0)? @me="<div class=global_module box_r>":@me="<div class=global_module>";[/field:global]

            {dede:arclist titlelen=’40′ row=’11′}    
           <a href="[field:arcurl /]" title="[field:title/]" target="_blank">[field:title /]</a>    
            {/dede:arclist}

        </div>
      {/dede:channelartlist}

循环生产列表,判断第二个就 加个样式<div class=global_module box_r>,否则就<div class=global_module>

貌似 不行,直接输出到页面显示的是
[field:global name=autoindex runphp="yes"](@me%2==0)? @me="":@me="";[/field:global] 

解决方法

[field:global name=autoindex runphp='yes']@me=$GLOBALS['autoindex']%2==0?’<div class="global_module box_r">’:'<div class="global_module">’;[/field:autoindex]

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表