不包含子栏目内容的方法:
{eycms:rs top="10" table="ey_content" where="islock=1 and classid=栏目ID" order="ontop desc,ordnum desc,id desc"}
{rs:eof}暂无资料{/rs:eof}
<a href="{$rs[link]}" title="{$rs[title]}">{eycms.cutstr($rs[title],80,1)}</a>
{/eycms:rs}
|
包含子栏目内容的方法:
{eycms:rs top="10" table="sd_content" where="islock=1 and classid in([eycms.get_sonid(栏目ID)])" order="ontop desc,ordnum desc,id desc"}
{rs:eof}暂无资料{/rs:eof}
<a href="{$rs[link]}" title="{$rs[title]}">{eycms.cutstr($rs[title],80,1)}</a>
{/eycms:rs}
|
说明:先定义$sonid变量获取栏目的所有子栏目集合,然后在where参数中直接调用$sonid即可
调用内容所属栏目的方法(带超链接)
<a href="{eycms.getcateurl($rs[classid])}">{eycms.getcatename($rs[classid])}</a>
|