二級導(dǎo)航欄如何實(shí)現(xiàn)兩級選中 ?
{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}目前只能實(shí)現(xiàn) 選中 當(dāng)前 欄目ID 如何能實(shí)現(xiàn)選中兩級
官方提醒:使用category欄目循環(huán)標(biāo)簽的生成工具,填寫參數(shù)就可以生成相關(guān)的代碼,每個(gè)參數(shù)后面都有用法解釋
寫法錯了,你參考默認(rèn)模板header。html的寫法
開源是一種精神,但不是義務(wù),幫忙是情分,不幫也不要抱怨,建議大家多研究代碼、多閱讀代碼、多翻閱社區(qū)歷史問題!
感謝,大佬,解決問題
{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}if $c.id == $cat.id} class="active"{/if}改成
{if IS_SHARE && $catid && in_array($catid, $c.catids)} class="active"{/if}默認(rèn)模板現(xiàn)成的寫法,哈哈