帝国cms 自定义页面 调用分类方法


avatar
pcwnas 2022-10-04 183

例子1:调用自定义页面分类ID=1的页面导航

[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']);
?>
<li><a href="<?=$pageurl?>"><?=$bqr[title]?></a></li>
[/e:loop]

例子2:调用自定义页面导航并识别当前自定义页面

[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]

 

暂无评论

当前仅支持登录后发布评论