灵动标签调用栏目导航技巧:
例一:灵动标签显示栏目导航
1 2 3 4 5 6 7 8 9 10 11 12 13 | <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 rel= "nofollow noopener noreferrer" href= "<?=$classurl?>" ><?= $bqr [classname]?></a></td> </tr> [/e:loop] </table> |
显示效果:
例二:灵动标签显示栏目导航,且给当前终极栏目的背景设为蓝色
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | <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 rel= "nofollow noopener noreferrer" href= "<?=$classurl?>" ><?= $bqr [classname]?></a></td> </tr> [/e:loop] </table> |
$GLOBALS[navclassid]为当前栏目ID。
例三:灵动标签显示一级栏目导航,且在子栏目时也给当前一级栏目设为蓝色背景
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | <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 wherebclassid=0order 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 rel= "nofollow noopener noreferrer" href= "<?=$classurl?>" ><?= $bqr [classname]?></a></td> </tr> [/e:loop] </table> |
本文帝国CMS灵动标签显示栏目导航&栏目高亮到此结束。或许人生不可能永如初见,但时光深处,抓住爱人的手,在平淡的岁月里守着一份细水长流的爱,风雨同舟不离不弃,这份情会比初见更美,更隽永,爱一个人就要爱他的所有,包括白发与皱纹。小编再次感谢大家对我们的支持!