💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
# 前端新增代码 * [ ] `介绍` 由于有些功能尚未开发,在原有基础上新加的功能,用法详见模板使用。 ***** ## 二级导航栏目功能,使用场景(如下图) ![](https://img.kancloud.cn/e7/7b/e77bf00317206bcba337b90f7b0f7673_784x395.png) 在\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} ```