帝国CMS调用同级栏目导航

[ 帝国cms教程   // 2014-03-12  ]
128

帝国CMS 列表模板、内容模板里调用同级栏目导航 :(通常用于网站侧边栏树形菜单代)码如下:

[showclasstemp]'selfinfo',1,0,0[/showclasstemp]

以上代码使用[showclasstemp]标签,会导致格式排版不友好,我们需要设置一下带模板的栏目标签:

设置步骤如下:

1、在自动生成标签中,选择 【带模板的栏目导航标签】选项;点击【管理模板标签】按钮;

2、在【管理标签模板】中复制需要设置的模板,比如【新闻系统模型】的【子栏目导航标签】选项;

3、在列表内容模板中填写相应的导航代码;

帝国CMS灵动标签获取当前栏目链接与当前栏目同级的所有栏目名称:

以下是代码,可以使用。

<?php

  $islast=$class_r[$GLOBALS[navclassid]][islast];
  $bclassid=$class_r[$GLOBALS[navclassid]][bclassid];

?>
         
          <div style="float:left; padding-left:15px; text-align:left;">
             <ul style="list-style-type:none;">
             <?php
   if($islast==1 and $bclassid==0)
   {
   ?>
               [e:loop={"select * from phome_ecms_news  where classid='".$GLOBALS[navclassid]."'",20,24,1}]
               <li style="list-style-type:none;">·&nbsp;<a href="<?=$bqsr[titleurl]?>"><?=esub($bqr[title],18)?></a><href="http://www.softhome.cc/li>
               [/e:loop]
               <?php
   }
   else if($islast==1 and $bclassid!=0)
   {
   ?>
               [e:loop={"select * from phome_enewsclass where  bclassid='".$bclassid."'",24,24,1}]
              <li style="list-style-type:none;">·&nbsp;<a href="[!--news.url--]<?=esub($bqr[classpath],200)?>"><?=esub($bqr[classname],18)?></a><href="http://www.softhome.cc/li>
               [/e:loop]
    <?php
    }
    else
    {
    ?>         [e:loop={"select * from phome_enewsclass where bclassid='".$GLOBALS[navclassid]."'",24,24,1}]
              <li style="list-style-type:none;">·&nbsp;<a href="[!--news.url--]<?=esub($bqr[classpath],200)?>" ><?=esub($bqr[classname],18)?></a><href="http://www.softhome.cc/li>
               [/e:loop]
    <?php
    }
    ?>
             </ul>
          </div>