迅睿CMS框架是一款PHP8高性能·簡單易用的CMS開源開發框架,基于MIT開源許可協議發布,免費且不限制商業使用,是免費開源的產品,以萬端互聯為設計理念,支持的微信公眾號、小程序、APP客戶端、移動端網站、PC網站等多終端式管理系統。
聯系官方銷售客服
1835022288
028-61286886
如何通過判斷導航欄目模型來調用欄目
{category module=share pid=0 return=t1}{if $t比如產品模型==1}
產品欄目
{elseif $t新聞模型==1}
新聞欄目
{else}
欄目
{/if}
官方提醒:使用category欄目循環標簽的生成工具,填寫參數就可以生成相關的代碼,每個參數后面都有用法解釋
$t1.mid=="news"表示news模塊,以此類推
回復@迅睿框架技術-李梧桐 同時間判斷2個模塊呢 news和product
不明白你的意思,因為一個欄目只能屬于一個模塊,不能同時屬于兩個模塊
回復@迅睿框架技術-李梧桐 應該是我理解問題,可以把代碼貼出來么
{category module=share pid=0 return=t1} {if $t1.mid=="product"} 產品欄目 {elseif $t1.mid=="news"} 新聞欄目 {else} 欄目 {/if} {/category}
套公式。。
四樓代碼可可以
回復@自學成才 是不是我代碼問題
<ul class="clearfix"> <li {if $indexc}class="cur" {/if}><a href="{SITE_URL}">首頁</a></li>{category module=share pid=0} <li {if IS_SHARE && $catid && dr_in_array($catid, $t.catids)}class="cur" {/if}> <a href="{$t.url}">{$t.name}</a> {if $t1.mid=="product"} <div class="navbox"> <div class="container"> <h3>{$t.name}</h3> <ol class="clearfix"> {category module=share pid=$t.id return=t2} <li> <span><a href="{$t2.url}">{$t2.name}</a></span>{if $t2.child} <div>{category module=share pid=$t2.id return=t3} <a href="{$t3.url}" title="{$t3.name}">{/category} </div>{/if} </li>{/category} </ol> </div> </div>{elseif $t1.mid=="news"} <div class="navbox navbox2"> <div class="container clearfix"> <div class="left"> <h3>{$t.name}</h3> <ol class="clearfix">{category module=share pid=$t.id return=t2} <li> <span><a href="{$t2.url}">{$t2.name}</a></span>{if $t2.child} <div>{category module=share pid=$t2.id return=t3} <a href="{$t3.url}" title="{$t3.name}">{/category} </div>{/if} </li>{/category} </ol> </div> <div class="right"> <img src="#" alt="專業技術團隊" /> <p>專業技術團隊</p> </div> </div> </div>{else} <div class="navbox navbox2 navbox3"> <div class="container clearfix"> <div class="left"> <h3>{$t.name}</h3> <ol class="clearfix"> {category module=share pid=$t.id return=t4} <li> <span><a href="{$t4.url}" title="{$t4.name}"></span> </li>{/category} </ol> </div> <div class="right"> <img src="picture/navbox3.jpg" alt="LED應用領域的創新者" /> <p>LED應用領域的創新者</p> </div> </div> </div> {/if} </li>{/category} </ul>
肯定有問題啊,上面都是$t.,你這里弄一個$t1,t1是哪里來的。。。。
回復@疾風 這個剛發得時候就看見了,還是有些問題
$t1.mid=="news"表示news模塊,以此類推
回復@迅睿框架技術-李梧桐 同時間判斷2個模塊呢 news和product
不明白你的意思,因為一個欄目只能屬于一個模塊,不能同時屬于兩個模塊
回復@迅睿框架技術-李梧桐 應該是我理解問題,可以把代碼貼出來么
套公式。。
四樓代碼可可以
回復@自學成才 是不是我代碼問題
肯定有問題啊,上面都是$t.,你這里弄一個$t1,t1是哪里來的。。。。
回復@疾風 這個剛發得時候就看見了,還是有些問題