假设要调用1,2,3,4,5这五个栏目名以及下属的文章,模版应该如下写:
<{getlists list="1,2,3,4,5" template="[item]" colspan="1" overflow="," assign="list" explode="," noelapse="1"}>
<{foreach item=cid from=$list}>
<{getcategories id=$cid template="<b>[category]</b><br />"}>
<{getitems category=$cid}>
<{/foreach}>
标红部分的两处名字可以随便起,需要一致起来。如果要调用的栏目经常修改,也可以把1,2,3,4,5放到变量中调用。
转载请注明:本文《循环调用栏目及下属文章》链接: http://seo.leidu.net/post-248.html
百度已收录
发表评论: