1、常用的是调用 位置1 的导航
{block:navigate}
<ul class="th_nav">
<li {if:empty($cfg_var['topcid'])} class="act"{/if}><a rel="nofollow" href="http://seo.leidu.net/go?url={$cfg[weburl]}" title="{$cfg[webname]}">首页</a></li>
{loop:$data $v}
<li{if:$cfg_var['topcid'] == $v['cid']} class="act"{/if}>
<a rel="nofollow" href="http://seo.leidu.net/go?url={$v[url]}" target="{$v[target]}" title="{$v[name]}">{$v[name]}{if:isset($v[son])}<i class="iconfont icon-jiantou"></i>{/if}</a>
{if:isset($v[son])}
<ul>
{loop:$v[son] $v2}<li><a rel="nofollow" href="http://seo.leidu.net/go?url={$v2[url]}" target="{$v2[target]}" title="{$v2[name]}">{$v2[name]}</a></li>{/loop}
</ul>
{/if}
</li>
{/loop}
</ul>
{/block}
如果你不需要显示二级导航:
{block:navigate}
<ul class="th_nav">
<li {if:empty($cfg_var['topcid'])} class="act"{/if}><a rel="nofollow" href="http://seo.leidu.net/go?url={$cfg[weburl]}" title="{$cfg[webname]}">首页</a></li>
{loop:$data $v}
<li{if:$cfg_var['topcid'] == $v['cid']} class="act"{/if}>
<a rel="nofollow" href="http://seo.leidu.net/go?url={$v[url]}" target="{$v[target]}" title="{$v[name]}">{$v[name]}</a>
</li>
{/loop}
</ul>
{/block}
如何调用位置2的导航?
(不要被表面的字义迷惑,实际上你也可以把他当做底部导航、最顶部导航等等)
{block:navigate mobile="1"}
<ul class="th_nav">
<li {if:empty($cfg_var['topcid'])} class="act"{/if}><a rel="nofollow" href="http://seo.leidu.net/go?url={$cfg[weburl]}" title="{$cfg[webname]}">首页</a></li>
{loop:$data $v}
<li{if:$cfg_var['topcid'] == $v['cid']} class="act"{/if}>
<a rel="nofollow" href="http://seo.leidu.net/go?url={$v[url]}" target="{$v[target]}" title="{$v[name]}">{$v[name]}</a>
</li>
{/loop}
</ul>
{/block}
只需要增加参数 mobile="1" 即可。
转载请注明:本文《navigate 导航》链接: http://seo.leidu.net/post-413.html
百度已收录
发表评论: