码迷,mamicode.com
首页 > Web开发 > 详细

phpcms之调用导航栏

时间:2018-01-25 12:03:05      阅读:286      评论:0      收藏:0      [点我收藏+]

标签:color   col   导航栏   url   top   name   order   cat   menu   

首页:

{pc:content action="category" catid="0" num="25" siteid="$siteid" order="listorder ASC"}
            <ul id="header-menu" class="menu">
                {if $top_parentid == 0}
                <li class="hover"><a href="{siteurl($siteid)}">首页</a></li>
                {else}
                <li><a href="{siteurl($siteid)}">首页</a></li>
                {/if}
                {loop $data $r}
                {if $catid == $r[catid] || $top_parentid == $r[catid]}
                <li class="hover"><a href="{$r[url]}">{$r[catname]}</a></li>
                {else}
                <li><a href="{$r[url]}">{$r[catname]}</a></li>
                {/if}
                {/loop}
            </ul>
            {/pc}

单页面:

  

{pc:content action="category" catid="0" num="25" siteid="$siteid" order="listorder ASC"}
            <ul id="header-menu" class="menu">
                {if $top_parentid == 0}
                <li class="hover"><a href="{siteurl($siteid)}">首页</a></li>
                {else}
                <li><a href="{siteurl($siteid)}">首页</a></li>
                {/if}
                {loop $data $r}
                {if $catid == $r[catid] || $top_parentid == $r[catid]}
                <li class="hover"><a href="{$r[url]}">{$r[catname]}</a></li>
                {else}
                <li><a href="{$r[url]}">{$r[catname]}</a></li>
                {/if}
                {/loop}
            </ul>
            {/pc}

 

{pc:content action="category" catid="0" num="25" siteid="$siteid" order="listorder ASC"}

               <ul id="header-menu" class="menu">

                      {if $top_parentid == 0}

                      <li class="hover"><a href="{siteurl($siteid)}">首页</a></li>

                      {else}

                      <li><a href="{siteurl($siteid)}">首页</a></li>

                      {/if}

                      {loop $data $r}

                      {if $catid == $r[catid] || $top_parentid == $r[catid]}

                      <li class="hover"><a href="{$r[url]}">{$r[catname]}</a></li>

                      {else}

                      <li><a href="{$r[url]}">{$r[catname]}</a></li>

                      {/if}

                      {/loop}

               </ul>

               {/pc}

phpcms之调用导航栏

标签:color   col   导航栏   url   top   name   order   cat   menu   

原文地址:https://www.cnblogs.com/l979662050/p/8350487.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!