# 前端新增代碼
* [ ] `介紹` 由于有些功能尚未開發,在原有基礎上新加的功能,用法詳見模板使用。
*****
## 二級導航欄目功能,使用場景(如下圖)

在\addons\cms\view\default\common文件夾下新建一個tow_nav.html文件,代碼如下。
```
<?php $isOnePage = $channel['id'] ?? false ?? true; ?>
{if $isOnePage}
<ul class="tow_nav">
{cms:channellist id="nav" type="top" }
{if $nav.id == $channel['id']}
<!-- 表單頁 -->
{cms:channellist id="sub2" type="son" typeid="$nav.id" condition="1=isnav"}
<li class="tow_nav_item">
<a href="{$sub2.url}" class="towa_nav_link {if $sub2.url == $channel.url} orange{/if}">{$sub2.name}</a>
</li>
{/cms:channellist}
{else /}
<!-- 單頁 -->
{cms:channellist id="sub" type="son" typeid="$nav.id" condition="1=isnav" condition="1=isnav"}
{if $sub.id == $channel['id']}
{cms:channellist id="sub2" type="son" typeid="$sub.parent_id" condition="1=isnav"}
<li class="tow_nav_item">
<a href="{$sub2.url}" class="towa_nav_link {if $sub2.id == $channel.id} orange{/if}">{$sub2.name}</a>
</li>
{/cms:channellist}
{/if}
{/cms:channellist}
{/if}
{/cms:channellist}
</ul>
{else/}
<?php $__CHANNEL__['parent_id'] == 0 ? $channelId = $__CHANNEL__['id'] : $channelId = $__CHANNEL__['parent_id']; ?>
<ul class="tow_nav">
<!-- 列表頁 -->
{cms:channellist id="sub" type="son" typeid="$channelId" condition="1=isnav"}
<li class="tow_nav_item">
<a href="{$sub.url}" class="towa_nav_link {if $sub.id == $__CHANNEL__.id} orange{/if}">{$sub.name}</a>
</li>
{/cms:channellist}
</ul>
{/if}
```
- 介紹
- 標簽手冊
- 全局標簽
- block標簽
- config標簽
- execute標簽
- query標簽
- breadcrumb標簽
- blocklist標簽
- 欄目標簽
- channellist標簽
- channel標簽
- nav標簽
- 文章標簽
- arclist標簽
- archives標簽
- prevnext標簽
- 專題
- speciallist標簽
- special標簽
- 公共參數
- common參數
- include引用
- 單頁
- spagelist標簽
- page標簽
- spageinfo標簽
- 特殊標簽
- tagslist標簽
- tags標簽
- commentlist標簽
- commentinfo標簽
- diyform標簽
- 模板特殊標簽
- 列表頁面
- pagelist標簽
- pageinfo標簽
- pagefilter標簽
- pageorder標簽
- pagelist的相關排序
- 新功能
- 后端新增代碼
- 模板使用
- 二級導航功能
- 共用banner功能
- 后臺站點配置添加編輯器