帝國 cms 導航條欄目轉場樣式

來源:互聯網
上載者:User
靈動標籤調用欄目導航技巧
本節通過用靈動標籤的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]

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.