帝国CMS自身的封面页的循环非常单调!一般只能加个头条、推荐之类的信息。现在分享一个支持内嵌标签的代码,可以做到不用写复杂的sql语法,就能实现在灵动标签中嵌套调用头条、图片等等自己想要的效果。代码如下所示:
<?php
$bclassid=$GLOBALS[navclassid]; //取得本栏目id
//取得本栏目下的子栏目
?>
[e:loop={"select classid, classname, classpath from `[!db.pre!]enewsclass` where bclassid='$bclassid' order by `classid` desc ",7,24,0}]
[ecmsinfo] $bqr[classid] ,14,30,1,0,29,0[/ecmsinfo]
[ecmsinfo] $bqr[classid] ,14,30,1,0,27,0[/ecmsinfo]
[/e:loop]
$bclassid=$GLOBALS[navclassid]; //取得本栏目id
//取得本栏目下的子栏目
?>
[e:loop={"select classid, classname, classpath from `[!db.pre!]enewsclass` where bclassid='$bclassid' order by `classid` desc ",7,24,0}]
[ecmsinfo] $bqr[classid] ,14,30,1,0,29,0[/ecmsinfo]
[ecmsinfo] $bqr[classid] ,14,30,1,0,27,0[/ecmsinfo]
[/e:loop]
调用效果如下: