三级菜单,显示一二两级,并高亮当前一级菜单。
<ul> <li> <a href="[!--news.url--]">首页</a> </li> [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);//取得栏目地址 $class=""; if($GLOBALS[navclassid]) { $fcr=explode('|',$class_r[$GLOBALS[navclassid]][featherclass]); $topbclassid=$fcr[1]?$fcr[1]:$GLOBALS[navclassid];//取得当前栏目的一级栏目ID if($bqr[classid]==$topbclassid) { $class="current"; } } ?> <li class="<?=$class?>"> <a href="<?=$classurl?>"> <?=$bqr[classname]?> </a> <div class="sub-nav"> <dl> <?php $ecms_bq_sql2=sys_ReturnEcmsLoopBq("select classid,classname,classpath,classurl from [!db.pre!]enewsclass where bclassid='$bqr[classid]' order by myorder limit 10",20,24,0); $bqno2=0; while($bqr2=$empire->fetch($ecms_bq_sql2)) { $bqsr2=sys_ReturnEcmsLoopStext($bqr2); $bqno2++; ?> <dd> <a href="<?=$public_r[newsurl]?>/ title="<?=$bqr2[classname]?>" target="_self"> <?=$bqr2[classname]?> </a> </dd> <?php } ?> </dl> </div> </li> [/e:loop] </ul>
current为高亮样式