navigation 导航标签使用
navigation属性列表
代码 | 名称 | 备注 |
---|---|---|
template | 模版模型 | product,picture,news,download, 等自定义支持多个隔开 |
id | 栏目 | id 1 多个2,3 |
pid | 栏目 | id 1 多个2,3 |
parent | 父栏目ID | 12 不支持多个 |
as | $vo | 覆值循环 |
如果同时存在优先级template,id,pid,parent ,都不传全部栏目
标签说明
navigation标签是导航专用,to函数也是导航专业跟jmp功能一样,只是to只需要专递导航值数组进去即可
调用案例
<!-- Fixed navbar -->
<nav id="top_nav" class="navbar navbar-default navbar-static-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<span id="small_search" class="glyphicon glyphicon-search" aria-hidden="true"></span>
<a class="navbar-brand" href="#">导航菜单</a>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
{navigation as=$vo }
{if isset($vo.data)}
<li class="dropdown">
<a href="{@to($vo)}">{$vo.name}</a>
<a href="{@to($vo)}" id="app_menudown" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"><span class="glyphicon glyphicon-menu-down btn-xs"></span></a>
<ul class="dropdown-menu nav_small" role="menu">
{foreach $vo.data as $svo }
<li><a href="{@to($svo)}">{$svo.name}</a></li>
{/foreach}
</ul>
</li>
{else}
<li><a href="{@to($vo)}">{$vo.name}</a></li>
{/if}
{/navigation}
</ul>
</div>
<!--/.nav-collapse -->
</div>
</nav>
调用案例二
{navigation as=$vo }
{if isset($vo.data)}
<li class="{@navactive($vo,__URL_NAME__,'active')}">
<a class="nav-yi" href="{@to($vo)}">{$vo.name}</a>
<div class="nav-er-box relative">
<div class="nav-tap">
{foreach $vo.data as $svo }
<div class="nav-er-list {@navactive($svo,__URL_NAME__)}">
<a class="nav-er" href="{@to($svo)}">{$svo.name}</a>
</div>
{/foreach}
</div>
</div>
</li>
{else}
<li class="{@navactive($vo,__URL_NAME__)}">
<a class="nav-yi" href="{@to($vo)}">{$vo.name}</a>
</li>
{/if}
{/navigation}
navactive 函数说明
navactive该函数被选热点 navactive(导航数组,当前页面URL名称,通过返回clsss名称)
该函数用选中热点,最多支持3级判断返还.
调用方法:{@navactive($vo,__URLNAME__ ,’active’)}
- 上一条: 没有了
- 下一条: 爬虫UA大全