zoukankan      html  css  js  c++  java
  • 帝国 cms 导航条栏目切换样式

    灵动标签调用栏目导航技巧
    本节通过用灵动标签的SQL语句查询来调用栏目导航。(当然栏目导航一般我们用现成的showclasstemp或listshowclass栏目导航标签调用)

    灵动标签调用栏目导航技巧:
    例一:灵动标签显示栏目导航

    <table width="200" border="0" cellpadding="3" cellspacing="1" bgcolor="#4FB4DE">
    <tr>
    <td height="25"><strong><font color="#FFFFFF">栏目导航</font></strong></td>
    </tr>
    [e:loop={"select classid,classname from {$dbtbpre}enewsclass where bclassid=父栏目id order by myorder,classid desc",0,24,0}]
    <?php
    $classurl=sys_ReturnBqClassname($bqr,9);//取得栏目地址
    ?>
    <tr>
    <td height="25" bgcolor="#FFFFFF"><a href="<?=$classurl?>"><?=$bqr[classname]?></a></td>
    </tr>
    [/e:loop]
    </table>

    显示效果:
    例二:灵动标签显示栏目导航,且给当前终极栏目的背景设为蓝色

    <table width="200" border="0" cellpadding="3" cellspacing="1" bgcolor="#4FB4DE">
    <tr>
    <td height="25"><strong><font color="#FFFFFF">栏目导航</font></strong></td>
    </tr>
    [e:loop={"select classid,classname from {$dbtbpre}enewsclass where bclassid=父栏目id order by myorder,classid desc",0,24,0}]
    <?php
    $classurl=sys_ReturnBqClassname($bqr,9);//取得栏目地址
    $bgcolor="#FFFFFF";
    if($bqr[classid]==$GLOBALS[navclassid])//当前栏目ID
    {
    $bgcolor="#C3EFFF";
    }
    ?>
    <tr>
    <td height="25" bgcolor="<?=$bgcolor?>"><a href="<?=$classurl?>"><?=$bqr[classname]?></a></td>
    </tr>
    [/e:loop]
    </table>

    $GLOBALS[navclassid]为当前栏目ID。
    例三:灵动标签显示一级栏目导航,且在子栏目时也给当前一级栏目的背景设为蓝色

    <table width="200" border="0" cellpadding="3" cellspacing="1" bgcolor="#4FB4DE">
    <tr>
    <td height="25"><strong><font color="#FFFFFF">栏目导航</font></strong></td>
    </tr>
    [e:loop={"select classid,classname from {$dbtbpre}enewsclass where bclassid=0 order by myorder,classid desc",0,24,0}]
    <?php
    $classurl=sys_ReturnBqClassname($bqr,9);//取得栏目地址
    $bgcolor="#FFFFFF";
    if($GLOBALS[navclassid])
    {
    $fcr=explode('|',$class_r[$GLOBALS[navclassid]][featherclass]);
    $topbclassid=$fcr[1]?$fcr[1]:$GLOBALS[navclassid];//取得当前栏目的一级栏目ID
    if($bqr[classid]==$topbclassid)
    {
    $bgcolor="#C3EFFF";
    }
    }

    ?>
    <tr>
    <td height="25" bgcolor="<?=$bgcolor?>"><a href="<?=$classurl?>"><?=$bqr[classname]?></a></td>
    </tr>
    [/e:loop]
    </table>

    [e:loop={"select classid,classname from {$dbtbpre}enewsclass where bclassid=0 order by myorder,classid desc",0,24,0}]
    <?php
    $classurl=sys_ReturnBqClassname($bqr,9);//取得栏目地址
    $bgclass="";
    if($GLOBALS[navclassid])
    {
    $fcr=explode('|',$class_r[$GLOBALS[navclassid]][featherclass]);
    $topbclassid=$fcr[1]?$fcr[1]:$GLOBALS[navclassid];//取得当前栏目的一级栏目ID
    if($bqr[classid]==$topbclassid)
    {
    $bgclass="current";
    }
    }
    ?>
    <li ><a href="<?=$classurl?>" class="<?=$bgclass?>"><strong><?=$bqr[classname]?></strong></a></li>
    [/e:loop]



  • 相关阅读:
    错误 : 资产文件“项目objproject.assets.json”没有“.NETCoreApp,Version=v2.0”的目标。确保已运行还原,且“netcoreapp2.0”已包含在项目的 TargetFrameworks 中。
    .NET core RSA帮助类
    vs2010单步调试崩溃
    常用排序算法比较与分析
    js原生的轮播图
    vue-cli脚手架使用-- 初学者
    vue-cli配置基础
    jq轮播图插件
    bootstrap 获得轮播中的索引或当前活动的焦点对象
    jQuery学习笔记之Ajax用法详解
  • 原文地址:https://www.cnblogs.com/wenus/p/2418488.html
Copyright © 2011-2022 走看看