帝国Cms怎么实现调用网站一级栏目和二级栏目做为网站导航
时间: 2020-12-28 作者:立威浏览:
修改头文件,具体代码如下
<nav class="nav"> <ul class="nav__menu"> <li class="nav__menu-item"><a href="[!--news.url--]" target="_self">首页</a></li> <?php $ecms_bq_sql=sys_ReturnEcmsLoopBq('select classid,classname,classpath from [!db.pre!]enewsclass where bclassid=0 and showclass=0 order by myorder limit 8',20,24,0); $bqno=0; while($bqr=$empire->fetch($ecms_bq_sql)) { $bqsr=sys_ReturnEcmsLoopStext($bqr); $bqno++; if($bqr[classid] != '23' ){ ?> <li class="nav__menu-item"><a href="<?=$public_r[newsurl]?><?=$bqr[classpath]?>" title="<?=$bqr[classname]?>" target="_self" ><?=$bqr[classname]?></a> <ul class="nav__submenu"> <?php $ecms_bq_sql2=sys_ReturnEcmsLoopBq("select classid,classname,classpath from [!db.pre!]enewsclass where bclassid='$bqr[classid]' order by myorder limit 5",20,24,0); $bqno2=0; while($bqr2=$empire->fetch($ecms_bq_sql2)) { $bqsr2=sys_ReturnEcmsLoopStext($bqr2); $bqno2++; ?> <li class="nav__submenu-item"><a href="<?=$public_r[newsurl]?><?=$bqr2[classpath]?>" title="<?=$bqr2[classname]?>" target="_self" ><?=$bqr2[classname]?></a></li> <?php } ?> </ul> </li> <?php } } ?> </ul> </nav>
你觉得文章内容怎么样