# 限制导航层级
我们的导航是支持无限级的,有时在制作导航时,只需要显示一级导航,或二级导航,通过设置navigation标签的 `max-level` 属性就可以了。
比如只显示一级导航,只要把 max-level 的值设置为1就可以了
```
<nav class="navbar navbar-default navbar-fixed-top active">
<div class="container active">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse"
data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="__ROOT__/">{$theme_vars.company_name|default='ThinkCMF'}</a>
</div>
<div class="collapse navbar-collapse active" id="bs-example-navbar-collapse-1">
<ul id="main-menu" class="nav navbar-nav">
<navigation nav-id="" root="" id="main-navigation" class="nav navbar-nav navbar-nav-custom"
max-level="1">
<navigationMenu root="li" class="menu-item menu-item-level-{$level} levelgt1">
<a href="{$menu.href|default=''}" target="{$menu.target|default=''}">
{$menu.name|default=''}
</a>
</navigationMenu>
<navigationFolder root="li"
class="dropdown dropdown-custom dropdown-custom-level-{$level}"
dropdown="ul"
dropdown-class="dropdown-menu dropdown-menu-level-{$level}">
<a href="#" class="dropdown-toggle dropdown-toggle-{$level}" data-toggle="dropdown">
{$menu.name|default=''}<span class="caret"></span>
</a>
</navigationFolder>
</navigation>
</ul>
</div>
</div>
</nav>
```