联系官方销售客服

1835022288

028-61286886

迅睿框架 版主:迅睿框架研发组
二级导航栏如何实现两级选中
类型:迅睿CMS 更新时间:2020-07-28 15:06:09

二级导航栏如何实现两级选中 ?  


{category module=share id=1,2,3 }
     <li><a href="{$t.url}"><button {if $cat.id == $t.id} class="active" {/if}>{$t.name}</button></a>
          {if $t.child}
           <div class="baikeList">
                {category module=share pid=$t.id return=c}
                <a href="{$c.url}" {if $c.id == $cat.id} class="active"{/if}>{$c.name}</a>
                {/category}
            </div>
           {/if}
      </li>
{/category}

目前只能实现 选中 当前  栏目ID  如何能实现选中两级

回帖
  • #1楼    迅睿框架创始人
    2020-07-23 17:02:45
    Google Pixel 手机 0
    写法错了,你参考默认模板header。html的写法
    满意答案
  • 宁静而致远
    #2楼    宁静而致远
    2020-07-23 17:07:25
    Chrome 0
    感谢,大佬,解决问题
    {category module=share id=1,2,3 }
         <li><a  target="_blank" href="{$t.url}"><button {if IS_SHARE && $catid && in_array($catid, $t.catids)} class="active"{/if}>{$t.name}</button></a>
              {if $t.child}
               <div class="baikeList">
                    {category module=share pid=$t.id return=c}
                    <a  target="_blank" href="{$c.url}" {if $c.id == $cat.id} class="active"{/if}>{$c.name}</a>
                    {/category}
                </div>
               {/if}
          </li>
    {/category}
  • sk360c
    #3楼    sk360c
    2020-07-23 17:12:20
    Chrome 0
    if $c.id == $cat.id} class="active"{/if}
    改成
    {if IS_SHARE && $catid && in_array($catid, $c.catids)} class="active"{/if}
    默认模板现成的写法,哈哈
  • 宁静而致远
    #4楼    宁静而致远
    2020-07-28 15:06:09
    Chrome 0
    迅睿框架创始人:已解决问题,已解决问题