帝国cms常见问题:灵动标签调用栏目高亮和子栏目的方法

本文实例讲述了帝国cms使用灵动标签实现当前栏目高亮的方法。分享给大家供大家参考。具体分析如下:效果图吐下帝国灵动标签栏目高亮代码如下[e:loop={"select classid,classn

本文实例讲述了帝国cms使用灵动标签实现当前栏目高亮的方法。分享给大家供大家参考。具体分析如下:h3WECMSPLUS

效果图吐下h3WECMSPLUS

帝国CMS(EmpireCMS)灵动标签调用栏目高亮和子栏目的方法h3WECMSPLUS

帝国灵动标签栏目高亮代码如下h3WECMSPLUS

[e:loop={"select classid,classname,sonclass from {$dbtbpre}enewsclass where bclassid=0 and showclass=0 order by myorder,classid asc",0,24,0}]  h3WECMSPLUS
     <?php  h3WECMSPLUS
       $classurl=sys_ReturnBqClassname($bqr,9);//取得栏目地址  h3WECMSPLUS

    h3WECMSPLUS
       $class="";  h3WECMSPLUS
      $menu="";h3WECMSPLUS
       if($GLOBALS[navclassid]){  h3WECMSPLUS
         $fcr=explode('|',$class_r[$GLOBALS[navclassid]][featherclass]);  h3WECMSPLUS
         $topbclassid=$fcr[1]?$fcr[1]:$GLOBALS[navclassid];//取得当前栏目的一级栏目ID  h3WECMSPLUS
         if($bqr[classid]==$topbclassid) {h3WECMSPLUS
           $class="active";  h3WECMSPLUS
         }  h3WECMSPLUS
      h3WECMSPLUS
     }  h3WECMSPLUS
if (!empty($bqr[sonclass])) {h3WECMSPLUS
           $menu="menu";h3WECMSPLUS
         }  h3WECMSPLUS

h3WECMSPLUS
     ?>  h3WECMSPLUS

h3WECMSPLUS
     <li class="<?=$menu?>"><a href="<?=$classurl?>" class="<?=$class?>"><?=$bqr[classname]?></a>h3WECMSPLUS

<!--子栏目调代码-->h3WECMSPLUS
</li>  h3WECMSPLUS
 h3WECMSPLUS

[/e:loop]h3WECMSPLUS

子栏目调用h3WECMSPLUS

<ul class="sub">h3WECMSPLUS
<?phph3WECMSPLUS

h3WECMSPLUS
$sql=$empire->query("select classid,classname from {$dbtbpre}enewsclass where bclassid=".$bqr[classid]." and showclass=0");        h3WECMSPLUS
while($r=$empire->fetch($sql))        //循环获取查询记录h3WECMSPLUS
{h3WECMSPLUS
  $classurl1=sys_ReturnBqClassname($r,9);//取得栏目地址  h3WECMSPLUS
?>h3WECMSPLUS
        h3WECMSPLUS

   h3WECMSPLUS
      <li><a href="<?=$classurl1 ?>"  target="_blank"><?=$r[classname]?></a></li>    h3WECMSPLUS

h3WECMSPLUS
<?phph3WECMSPLUS
}h3WECMSPLUS

?>h3WECMSPLUS

</ul>h3WECMSPLUS

其他答案
做你王 2020-09-08 16:28:15
热心网友
很好,教程很简单,复制粘贴就完成了
小情绪 2020-09-09 00:55:18
热心网友
谢谢小编的分享,教程很好。帝国灵动标签调用栏目和高亮一下就实现了

如下示例代码:

<p>[e:loop={&quot;select classid,classname,sonclass from {$dbtbpre}enewsclass where bclassid=0 and showclass=0 order by myorder,classid asc&quot;,0,24,0}] &nbsp;<br />&nbsp; &nbsp; &nbsp;&lt;?php &nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp;$classurl=sys_ReturnBqClassname($bqr,9);//取得栏目地址 &nbsp;</p><p>&nbsp; &nbsp;&nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp;$class=&quot;&quot;; &nbsp;<br />&nbsp; &nbsp; &nbsp; $menu=&quot;&quot;;<br />&nbsp; &nbsp; &nbsp; &nbsp;if($GLOBALS[navclassid]){ &nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$fcr=explode(&#39;|&#39;,$class_r[$GLOBALS[navclassid]][featherclass]); &nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$topbclassid=$fcr[1]?$fcr[1]:$GLOBALS[navclassid];//取得当前栏目的一级栏目ID &nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if($bqr[classid]==$topbclassid) {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$class=&quot;active&quot;; &nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;} &nbsp;<br />&nbsp; &nbsp; &nbsp;&nbsp;<br />&nbsp; &nbsp; &nbsp;} &nbsp;<br />if (!empty($bqr[sonclass])) {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$menu=&quot;menu&quot;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;} &nbsp;</p><p><br />&nbsp; &nbsp; &nbsp;?&gt; &nbsp;</p><p><br />&nbsp; &nbsp; &nbsp;&lt;li class=&quot;&lt;?=$menu?&gt;&quot;&gt;&lt;a href=&quot;&lt;?=$classurl?&gt;&quot; class=&quot;&lt;?=$class?&gt;&quot;&gt;&lt;?=$bqr[classname]?&gt;&lt;/a&gt;</p><p>&lt;!--子栏目调代码--&gt;<br />&lt;/li&gt; &nbsp;<br />&nbsp;</p><p>[/e:loop]</p>
分享到 :
相关推荐

发表评论

登录... 后才能评论

评论(3)

加入本站VIP会员订阅计划,海量资源免费下载查看

目前为止共有3位优秀的VIP会员加入!

立即加入VIP会员