迅睿CMS框架是一款PHP8高性能·簡單易用的CMS開源開發框架,基于MIT開源許可協議發布,免費且不限制商業使用,是免費開源的產品,以萬端互聯為設計理念,支持的微信公眾號、小程序、APP客戶端、移動端網站、PC網站等多終端式管理系統。
聯系官方銷售客服
1835022288
028-61286886
首頁怎么循環調用文章多個同級別欄目的數據?
如:ID=1的頂級欄目下面有子欄目:欄目一 、欄目二 ,這樣的話。怎么循環調用這子欄目的數據在首頁呢?
可以貼出代碼嗎?
{category module=news id=1 pid=0 return=c1}
{module module=news pid=$t.id order=updatetime num=9}
{/module}
{/category}
官方提醒:使用module內容循環標簽的生成工具,填寫參數就可以生成相關的代碼,每個參數后面都有用法解釋
官方提醒:使用category欄目循環標簽的生成工具,填寫參數就可以生成相關的代碼,每個參數后面都有用法解釋
{category module=news id=1 pid=0 return=c1} 這樣寫只能調用id1的欄目并且他是頂級欄目
{module module=news catid=$c1.id order=updatetime num=9}
{$t.title}
catid=$c1.id
已經解決,貼出來備注下:
{category module=news id=1 pid=0 return=c1} 我是父欄目:{$c1.name}<br> {category module=news pid=$c1.id return=c2} 我是{$c1.name}的子欄目:{$c2.name}<br> {module module=news catid=$c2.id order=updatetime num=9}<a href="{$t.url}">{$t.title}</a>{/module} {/category}{/category}
{category module=news id=1 pid=0 return=c1} 這樣寫只能調用id1的欄目并且他是頂級欄目
{module module=news catid=$c1.id order=updatetime num=9}
{$t.title}
{/module}
{/category}
catid=$c1.id
已經解決,貼出來備注下:
{category module=news id=1 pid=0 return=c1}
我是父欄目:{$c1.name}<br>
{category module=news pid=$c1.id return=c2}
我是{$c1.name}的子欄目:{$c2.name}<br>
{module module=news catid=$c2.id order=updatetime num=9}
<a href="{$t.url}">{$t.title}</a>
{/module}
{/category}
{/category}