dedecms二级菜单实现

修改channelartlist.lib.php

if($typeid==0 || $typeid=='top') {
$tpsql = " reid=0 AND ispart<>2 AND ishidden<>1 AND channeltype>0 ";
}

修改为

if($typeid=='tops') {
$tpsql = " reid=0 AND ispart<>2 AND ishidden<>1 ";
}elseif($typeid==0 || $typeid=='top') {
$tpsql = " reid=0 AND ispart<>2 AND ishidden<>1 AND channeltype>0 ";
}

然后页面调用

{dede:channelartlist typeid='tops' row=10}
<li>
<a href="{dede:field.typeurl/}">{dede:field.typename/}</a>
<ul>
{dede:channel row='10'}
<li><a href='[field:typeurl/]' [field:rel/]>[field:typename/]</a></li>
{/dede:channel}
</ul>
</li>
{/dede:channelartlist}
上一篇:【工具】代码生成器-python脚本


下一篇:xml与json 介绍