如题,帝国CMS用灵动标签来实现任意页面调用指定栏目下的所有子栏目。
[e:loop={
'select classid,classname,classpath from [!db.pre!]enewsclass where bclassid=1 and showclass=0 order by myorder,classid desc'
,0,24,0}]
<li><a href=
"<?=$public_r[newsurl]?><?=$bqr[classpath]?>"
title=
"<?=$bqr[classname]?>"
target=
"_blank"
><?=
$bqr
[classname]?></a></li>
[/e:loop]
eg:[e:loop={'select classid,classname,classpath from [!db.pre!]enewsclass where bclassid=5 and showclass=0 order by myorder,classid desc',0,24,0}]
<tr>
<td height="26"><table width="274" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="75" align="right"><img src="[!--news.url--]skin/muban/img/index/18.png" width="9" height="7" class="png" /> </td>
<td><A href="<?=$public_r[newsurl]?><?=$bqr[classpath]?>" style="font-size:14px; color:#412814; text-indent:10px;; font-family: "微软雅黑"" onmouseover="this.style.color='#F6F3B6';" onmouseout="this.style.color='#412814';"><?=$bqr[classname]?></A></td>
</tr>
</table></td>
</tr>
<tr>
<td height="4"><img src="[!--news.url--]skin/muban/img/index/17.png" width="274" height="4" class="png" /></td>
</tr>
[/e:loop]
<?php
$bclassid=$GLOBALS[navclassid]; //取得本栏目id
//取得本栏目下的子栏目
?>
[e:loop={"select classid, classname, classpath from `[!db.pre!]enewsclass` where bclassid='$bclassid' order by `classid` desc ",5,24,0,0,0}]
这里加想循环的子栏目信息
子栏目名称:<?=$class_r[$bqr[classid]]['classname']?>
子栏目链接:<?=$class_r[$bqr[classid]]['classpath']?>
子栏目id:$bqr[classid]
标签调用信息:[ecmsinfo] $bqr[classid] ,8,12,0,0,15,0,0,0[/ecmsinfo]
[/e:loop]
扫一扫手机访问
