phpcms二级栏目的调用

1、二级栏目的调用方法

 

{php $data = subcat($module, $catid);}
{loop $data $n $r}
{if $r[ismenu]}
{$r[catname]}
{get sql="select catname,url from phpcms_category where parentid='$r[catid]'" return="v"}
{$v[catname]}
{/get}
{/if}
{/if}
{/loop}

 

2.导航如何实现一级栏目后跟特定的二级栏目 

{pc:content action="category" catid="0" num="25" siteid="$siteid" order="listorder ASC"}
         <ul class="nav-site">
   <li><a href="{siteurl($siteid)}"><span>首页</span></a></li>
   {loop $data $r}
   <li class="line">|</li>
   <li><a href="{$r[url]}"><span>{$r[catname]}</span></a></li>
                {pc:content action="category" catid="2" num="3" siteid="$siteid" order="listorder ASC"}
                {loop $data $r}
                <li><a href="{$r[url]}">{$r[catname]}</a><span> | </span></li>
                {/loop}
                {/pc}
   {/loop}
            </ul>
        {/pc}
{pc:content action="category" catid="2" num="3" siteid="$siteid" order="listorder ASC"}

 

posted @ 2016-08-11 14:03  KSnow  阅读(1494)  评论(0编辑  收藏  举报