phpcms有二级导航并且高亮效果代码

<div class="collapse navbar-collapse" id="example-navbar-collapse">
                <ul class="nav navbar-nav">
                    <!--{pc:get sql="select * from v9_category order by listorder ASC" }-->
                    {pc:content action="category" catid="0" num="10" siteid="$siteid" order="listorder ASC"}
                        {if $catid}
                            <li><a href="{siteurl($siteid)}">首页</a></li>
                        {else}
                            <li class="active"><a href="{siteurl($siteid)}">首页</a></li>
                        {/if}
                        {loop $data $r}
                            {if $r[child]}
                            <li {if $catid==$r['catid'] || $top_parentid==$r[catid] || $parentid==$r[catid]}class="active"{/if}>
                                <a href="{$r[url]}" class="dropdown-toggle" data-toggle="dropdown">{$r[catname]}<b class="caret"></b></a>
                                <ul class="dropdown-menu">
                                    {pc:content action="category" catid="$r[catid]" num="10" siteid="$siteid" order="listorder ASC" return="data2"}
                                        {loop $data2 $v}
                                        <li><a href="{$v[url]}">{$v[catname]}</a></li>
                                        {/loop}
                                    {/pc}
                                </ul>    
                            </li>
                            {else}
                                <li {if $catid==$r['catid']}class="active"{/if}><a href="{$r[url]}">{$r[catname]}</a></li>
                            {/if}
                        {/loop}

                    {/pc}
                </ul>
            {php echo runhook('glogal_menu')}
           </div>

截图:

posted @ 2017-07-04 15:01  风雨后见彩虹  阅读(921)  评论(0编辑  收藏  举报