{pc:content action=“category” catid=“$catid” num=“99” order=“listorder ASC”}
{loop $data $cat}
{pc:content action=“lists” catid=“$cat['catid']” order=“id DESC” num=“6” return=“subcate”}
{if $subcate}
<h2><a href=“{$cat['url']}”>{$cat['catname']}</a></h2>
<ul class=“news_list”>
{loop $subcate $r}
<li><span>{date(‘Y/m/d H:i',$r['inputtime'])}</span><a{if $n==1} class=“b”{/if} href=“{$r['url']}”>{$r['title']}</a></li>
{/loop}
</ul>
{/if}
{/pc}
{/loop}
{/pc}
phpcms 列表页中如何调用其下的所有子栏目图解
或者直接调用数据表
{pc:get sql=“select * from phpcms_category where catid in(你的子栏目ID)” return=“data”}
{loop $data $r}
<a href=“{$r['url']}”>{$r['catname']}</a>
{/loop}
{/pc}
如果你的子栏目ID是18,19,20的话,条件哪里就写成in(18,19,20)
评论(0人参与,0条评论)
发布评论
最新评论