迅睿CMS框架是一款PHP8高性能·簡單易用的CMS開源開發框架,基于MIT開源許可協議發布,免費且不限制商業使用,是免費開源的產品,以萬端互聯為設計理念,支持的微信公眾號、小程序、APP客戶端、移動端網站、PC網站等多終端式管理系統。
聯系官方銷售客服
1835022288
028-61286886
請問一下,想在導航欄判斷下是否是當前欄目并且加個樣式,應該怎么寫,謝謝
{if $catid==$t.catid}class="active"{/if}
回復@琉惗
沒有成功,這樣寫對么
<a href="/">首頁</a> <a {if $catid==$t.catid}class="home"{/if} href="/index.php?s=news&c=category&id=1">第一個</a> <a {if $catid==$t.catid}class="home"{/if} href="/index.php?s=news&c=category&id=2">第二個</a> <a {if $catid==$t.catid}class="home"{/if} href="/index.php?s=news&c=category&id=3">第三個</a> <a {if $catid==$t.catid}class="home"{/if} href="/index.php?s=news&c=category&id=4">第四個</a> <a {if $catid==$t.catid}class="home"{/if} href="/index.php?s=news&c=category&id=5">第五個</a> <a {if $catid==$t.catid}class="home"{/if} href="/index.php?s=news&c=category&id=6">第六個</a>
你是在逗我么,你欄目一個個寫不自己調用?
你沒有循環,哪來的
$t.catid
直接寫
{if $catid==1}class="home"{/if}
http://www.zbshanke.com/doc/389.html
用這個,用循環把欄目調出來,完了用我給你的方法,這樣就可以了
{if $catid==$t.catid}class="active"{/if}
回復@琉惗
沒有成功,這樣寫對么
你是在逗我么,你欄目一個個寫不自己調用?
你沒有循環,哪來的
直接寫
http://www.zbshanke.com/doc/389.html
用這個,用循環把欄目調出來,完了用我給你的方法,這樣就可以了