迅睿開源框架是一款PHP8高性能·簡(jiǎn)單易用的PHP開源開發(fā)框架, 基于MIT開源許可協(xié)議發(fā)布,不限制商業(yè)使用,以多端互聯(lián)為設(shè)計(jì)理念, 支持的微信公眾號(hào)、小程序、APP客戶端、移動(dòng)端網(wǎng)站、PC網(wǎng)站等多終端式管理系統(tǒng)。
業(yè)務(wù)經(jīng)理
微信掃描以上二維碼
028-61286886
技術(shù)咨詢
如何通過(guò)判斷導(dǎo)航欄目模型來(lái)調(diào)用欄目
{category module=share pid=0 return=t1}{if $t比如產(chǎn)品模型==1}
產(chǎn)品欄目
{elseif $t新聞模型==1}
新聞欄目
{else}
欄目
{/if}
官方提醒:使用category欄目循環(huán)標(biāo)簽的生成工具,填寫參數(shù)就可以生成相關(guān)的代碼,每個(gè)參數(shù)后面都有用法解釋
$t1.mid=="news"表示news模塊,以此類推
開源是一種精神,但不是義務(wù),幫忙是情分,不幫也不要抱怨,建議大家多研究代碼、多閱讀代碼、多翻閱社區(qū)歷史問(wèn)題!
回復(fù)@迅??蚣芗夹g(shù)-李梧桐 同時(shí)間判斷2個(gè)模塊呢 news和product
不明白你的意思,因?yàn)橐粋€(gè)欄目只能屬于一個(gè)模塊,不能同時(shí)屬于兩個(gè)模塊
回復(fù)@迅??蚣芗夹g(shù)-李梧桐 應(yīng)該是我理解問(wèn)題,可以把代碼貼出來(lái)么
{category module=share pid=0 return=t1} {if $t1.mid=="product"} 產(chǎn)品欄目 {elseif $t1.mid=="news"} 新聞欄目 {else} 欄目 {/if} {/category}
套公式。。
四樓代碼可可以
回復(fù)@自學(xué)成才 是不是我代碼問(wèn)題
<ul class="clearfix"> <li {if $indexc}class="cur" {/if}><a href="{SITE_URL}">首頁(yè)</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="專業(yè)技術(shù)團(tuán)隊(duì)" /> <p>專業(yè)技術(shù)團(tuán)隊(duì)</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應(yīng)用領(lǐng)域的創(chuàng)新者" /> <p>LED應(yīng)用領(lǐng)域的創(chuàng)新者</p> </div> </div> </div> {/if} </li>{/category} </ul>
肯定有問(wèn)題啊,上面都是$t.,你這里弄一個(gè)$t1,t1是哪里來(lái)的。。。。
回復(fù)@疾風(fēng) 這個(gè)剛發(fā)得時(shí)候就看見了,還是有些問(wèn)題
$t1.mid=="news"表示news模塊,以此類推
開源是一種精神,但不是義務(wù),幫忙是情分,不幫也不要抱怨,建議大家多研究代碼、多閱讀代碼、多翻閱社區(qū)歷史問(wèn)題!
回復(fù)@迅??蚣芗夹g(shù)-李梧桐 同時(shí)間判斷2個(gè)模塊呢 news和product
不明白你的意思,因?yàn)橐粋€(gè)欄目只能屬于一個(gè)模塊,不能同時(shí)屬于兩個(gè)模塊
開源是一種精神,但不是義務(wù),幫忙是情分,不幫也不要抱怨,建議大家多研究代碼、多閱讀代碼、多翻閱社區(qū)歷史問(wèn)題!
回復(fù)@迅??蚣芗夹g(shù)-李梧桐 應(yīng)該是我理解問(wèn)題,可以把代碼貼出來(lái)么
{category module=share pid=0 return=t1} {if $t1.mid=="product"} 產(chǎn)品欄目 {elseif $t1.mid=="news"} 新聞欄目 {else} 欄目 {/if} {/category}套公式。。
四樓代碼可可以
回復(fù)@自學(xué)成才 是不是我代碼問(wèn)題
<ul class="clearfix"> <li {if $indexc}class="cur" {/if}><a href="{SITE_URL}">首頁(yè)</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="專業(yè)技術(shù)團(tuán)隊(duì)" /> <p>專業(yè)技術(shù)團(tuán)隊(duì)</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應(yīng)用領(lǐng)域的創(chuàng)新者" /> <p>LED應(yīng)用領(lǐng)域的創(chuàng)新者</p> </div> </div> </div> {/if} </li>{/category} </ul>肯定有問(wèn)題啊,上面都是$t.,你這里弄一個(gè)$t1,t1是哪里來(lái)的。。。。
回復(fù)@疾風(fēng) 這個(gè)剛發(fā)得時(shí)候就看見了,還是有些問(wèn)題