循环调用某一类别下子类别内容的方法

日期:2021-10-21 人气:2238
12345678910111213141516171819202122232425262728
{cms:rp top="5" table="cms_category" where="followid=栏目ID" order="catenum,cateid" auto="j"}
{php $sonid=get_sonid_all($rp[cateid])}
<div class="subject"><span><a href="{cateurl($rp[cateid])}">MORE+</a></span>{$rp[catename]}</div>
<ul>
{cms:rs top="10" table="cms_content" where="islock=1 and classid in($sonid)" order="ontop desc,ordnum desc,id desc"}
{rs:eof}暂无资料{/rs:eof}
<li><span>[{date('m-d',$rs[createdate])}]</span><a href="{$rs[link]}" title="{$rs[title]}">{cutstr($rs[title],56,1)}</a></li>
{/cms:rs}
</ul>
{/cms:rp}

CSS样式部分请自己书写,把栏目ID换成你的大栏目ID,注意top参数限制了数量.

上一篇: 单独调用某个栏目的名称/链接等方法

下一篇:内容页按大栏目ID显示相关内容的标签教程

帮助