织梦dedecms二级菜单完成方法
发布时间:2021-12-16 10:32 所属栏目:19 来源:互联网
导读:dedecms是支持二级菜单了,但是我们需要分开来做,现在我们稍加改一下就可以实现调用时不需要知道ID即可根据大类小子类了,具体如下. 例子1,修改channelartlist.lib.php,代码如下: if($typeid==0 || $typeid==top) { $tpsql = reid=0 AND ispart2 AND ishidden1
dedecms是支持二级菜单了,但是我们需要分开来做,现在我们稍加改一下就可以实现调用时不需要知道ID即可根据大类小子类了,具体如下. 例子1,修改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 "; //开源软件:Cuoxin.com } 然后页面调用如下代码: {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} 例子2,首先在你的css里面加入如下代码: * { PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-LEFT: 0px; PADDING-RIGHT: 0px; PADDING-TOP: 0px } A { text-decoration:none; } DIV { WORD-WRAP: break-word; WORD-BREAK: break-all } LI { LIST-STYLE-TYPE: none; LIST-STYLE-IMAGE: none } .nav { MARGIN: 7px auto 0px; WIDTH: 968px; OVERFLOW: hidden } .nav LI { FLOAT: left; HEIGHT: 48px } .nav_left { WIDTH: 8px; BACKGROUND: url(img/s02.gif) no-repeat } .nav_center { WIDTH: 952px; BACKGROUND: url(img/s03.gif) repeat-x; FONT-SIZE: 16px } .nav_right { WIDTH: 8px; BACKGROUND: url(img/s04.gif) no-repeat } .nav_li_li { PADDING-RIGHT: 2px; BACKGROUND: url(img/s05.gif) no-repeat right top } .nav A { PADDING-BOTTOM: 0px; LINE-HEIGHT: 42px; PADDING-LEFT: 49px; PADDING-RIGHT: 49px; FLOAT: left; HEIGHT: 48px; COLOR: #fff; PADDING-TOP: 0px } .nav .nav_on { BACKGROUND: url(img/s06.jpg) no-repeat center top; TEXT-DECORATION: none } .nav A:hover { BACKGROUND: url(img/s06.jpg) no-repeat center top; TEXT-DECORATION: none } .nav_li_li DIV { Z-INDEX: 1000; BORDER-BOTTOM: #5970b2 1px solid; POSITION: absolute; BORDER-LEFT: #5970b2 1px solid; PADDING-BOTTOM: 5px; MARGIN-TOP: 42px; PADDING-LEFT: 5px; WIDTH: 190px; PADDING-RIGHT: 5px; ZOOM: 1; BACKGROUND: #ffffff 0px 0px; VISIBILITY: hidden; BORDER-TOP: #5970b2 1px solid; BORDER-RIGHT: #5970b2 1px solid; PADDING-TOP: 5px } SIZE: 12px; TEXT-DECORATION: none; PADDING-TOP: 5px } .nav_li_li DIV A:hover { BACKGROUND: #49a3ff; COLOR: #fff } (编辑:ASP站长网) |
相关内容
网友评论
推荐文章
热点阅读