需求:我要顯示指定子欄目下的文章內(nèi)容,和調(diào)用該子欄目下有多少文章內(nèi)容的信息
寫法
{category module=share id=202 return=c1} <!--指定子欄目202-->
{$c1.name}
{module module=share catid=202 order=displayorder num=7}<!--再次指定子欄目202-->
{$key+1}<!--文章序號-->
{$t.url}<!--文章鏈接-->
{$t.title}<!--文章標(biāo)題-->
{/module}
{$c1.url}<!--子欄目鏈接-->
{php echo \Phpcmf\Service::M()->db->table('1_news_index')->where('status=9')->where('catid=202')->countAllResults();}<!--子欄目文章數(shù)量-->
{/category}上面這個(gè)這個(gè)是運(yùn)行正常的 現(xiàn)在我想批量調(diào)5個(gè)子欄目下的文章和顯示子欄目下的文章數(shù)量,也就是想只改這里
{category module=share id=202,203,204,205,206 return=c1} <!--指定子欄目202-->
{$c1.name}
{module module=share catid=202,203,204,205,206 order=displayorder num=7}<!--再次指定子欄目202-->
{$key+1}<!--文章序號-->
{$t.url}<!--文章鏈接-->
{$t.title}<!--文章標(biāo)題-->
{/module}
{$c1.url}<!--子欄目鏈接-->
{php echo \Phpcmf\Service::M()->db->table('1_news_index')->where('status=9')->where('catid=202,203,204,205,206')->countAllResults();}<!--子欄目文章數(shù)量-->
{/category}但發(fā)現(xiàn)用這種傻辦法,行不通,,估計(jì)紅色圈里是對的,藍(lán)色圈里不對,但我試了用

catid=$c1.id catid=$t.id
都不行,,麻煩大佬們給指點(diǎn)下,謝謝,,藍(lán)色圈里要怎么寫,或者有沒有其它的好辦法
官方提醒:使用module內(nèi)容循環(huán)標(biāo)簽的生成工具,填寫參數(shù)就可以生成相關(guān)的代碼,每個(gè)參數(shù)后面都有用法解釋
官方提醒:使用category欄目循環(huán)標(biāo)簽的生成工具,填寫參數(shù)就可以生成相關(guān)的代碼,每個(gè)參數(shù)后面都有用法解釋
{category module=share id=202,203,204,205,206 return=c1} <!--指定子欄目202--> {$c1.name} {module module=share catid=$c1.id order=displayorder num=7}<!--再次指定子欄目202--> {php echo \Phpcmf\Service::M()->db->table('1_news_index')->where('status=9')->where('catid='.$c1['id'])->countAllResults();}<!--子欄目文章數(shù)量--> {/category}開源是一種精神,但不是義務(wù),幫忙是情分,不幫也不要抱怨,建議大家多研究代碼、多閱讀代碼、多翻閱社區(qū)歷史問題!