联系官方销售客服

1835022288

028-61286886

POSCMS 版主:POSCMS负责人
怎么实现一级栏目有子栏目时 添加css class属性
类型:POSCMS 更新时间:2018-10-02 16:08:27 子栏目
        {list action=category module=share pid=0}  
          <li><a href="{$t.url}">{$t.name} <span class="caret"></span></a>
           {if $t.child}
            <ul class="dropdown-menu">
             {list action=category module=share pid=$t.id return=t2}
              <li><a href="{$t2.url}">{$t2.name} <span class="caret"></span></a>
              {if $t2.child}
                <ul class="dropdown-menu">
                  {list action=category module=share pid=$t2.id return=t3}
                  <li><a href="{$t3.url}">{$t3.name}</a></li>
                  {/list}
                </ul>
                {/if}
              </li>
               {/list}
            </ul>
            {/if}
          </li>
{/list}
如代码所示想给有二级栏目的一级栏目添加个caret 属性   不知道怎么写了
回帖
  • 江源
    #1楼    江源
    2018-10-02 09:26:09
    1
     <span    {if $t.child}class="caret"{/if}></span>
    满意答案
  • jianwang
    #2楼    jianwang
    2018-10-02 16:06:23
    0
    江源不起作用呢
  • jianwang
    #3楼    jianwang
    2018-10-02 16:08:27
    0
    按照此方法 可以了 谢谢大神