只需一步,快速开始
管理员
{pc:get sql="SELECT * FROM `v9_linkage` WHERE parentid=0 AND keyid=1 ORDER BY listorder ASC" num="100" return="data" }<!--调用条件说明:parentid=0,父级ID(默认联动菜单“中国”);keyid=1,菜单ID,添加字段时使用那个的ID--> {loop $data $n $v} <li> <h2><a href="{$v['linkageid']}" title="{$v['name']}" target="_blank">{$v['name']}</a></h2> <ul> <!--二级调用--> {pc:get sql="SELECT * FROM `v9_linkage` WHERE parentid=$v[linkageid] ORDER BY listorder ASC" num="100" return="smenu" } {loop $smenu $n $m} <li> <h3><a href="{$m['linkageid']}" title="{$m['name']}" target="_blank">{$m['name']}</a></h3> <!--三级调用 如此循环可以调用4级、5级.....无限级分类--> {pc:get sql="SELECT * FROM `v9_linkage` WHERE parentid=$m[linkageid] ORDER BY listorder ASC" num="100" return="tmenu" } <h4> {loop $tmenu $n $r} <a href="{$r['linkageid']}" title="{$r['name']}" target="_blank">{$r['name']}</a> {/loop} </h4> {/pc} </li> {/loop} {/pc} </ul> </li> {/loop} {/pc}
使用道具 举报
发表回复 回帖后跳转到最后一页
手机版|Scripts 学盟 |
GMT+8, 2024-12-19 01:35 , Processed in 1.077400 second(s), 13 queries .
Powered by Discuz! X2
© 2001-2011 Comsenz Inc.