帝国CMS导航调用自定义页面高亮识别当前页面方法


avatar
pcwnas 2023-04-21 168

常常需要利用自定义页面来制作单页面,并放置在导航里,又希望能实现当前自定义页面高亮

[e:loop={'select id,path,title from [!db.pre!]enewspage where classid=1 order by id',20,24,0}]<?php$pageurl=$public_r['newsurl'].str_replace('../../','',$bqr['path']);$css='pagecss';if($classid=='page'.$bqr[id]){        $css='selfpagecss';}?><li class="<?=$css?>"><a href="<?=$pageurl?>"><?=$bqr[title]?></a></li>[/e:loop]