ottom:0.5em;padding:0px;text-indent:2em;font-family:Verdana,Geneva,sans-serif;font-size:15px;line-height:27px;white-space:normal;"> 有时咱们需要制作二级分类,三级分类,甚至更多级别的分类,那么PHPCMS如何调用多级分类呢?
ottom:0.5em;padding:0px;text-indent:2em;font-family:Verdana,sans-serif;font-size:15px;line-height:27px;white-space:normal;"> 首先看看如何取出一级分类
ottom:0.5em;padding:1em 2em;background-color:#E2DBD1;border-top-left-radius:10px;border-top-right-radius:10px;border-bottom-right-radius:10px;border-bottom-left-radius:10px;line-height:1.2em;text-shadow:#FFFFFF 0px 1px 1px;color:#444444;font-family:Georgia,'Bitstream Vera Serif','Times New Roman',serif;overflow:auto;font-size:15px;">{pc:content action="category" catid="0" order="listorder DESC"} {loop $data $r}
{pc:content action="category" catid="$r[catid]" order="listorder DESC"} {loop $data $v}
- {/loop} {/pc} @H_404_7@ {/loop} {/pc}
ottom:0.5em;padding:0px;text-indent:2em;font-family:Verdana,sans-serif;font-size:15px;line-height:27px;white-space:normal;"> 这里重点是 $r[catid] --- 上一级分类的ID,要想第三级分类,再嵌套一层,那么获取的上级分类ID就是 $v[catid] ,不断的更改loop循环的关键字的值,在这里第一级是$r,第二级是$v,第三级可以是$k,总之跟之前的不重复就行,分类调用。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。