織夢導(dǎo)航菜單調(diào)用代碼
<ul>
<li><a href="/">首頁</a></li>
{dede:channelartlist typeid="top" row='18' currentstyle="<li class='active'><a href='~typelink~' ~rel~><span>~typename~</span></a></li>"}
<li><a href="{dede:field name="typeurl"/}" target="_blank">{dede:field name="typename"/}</a>
<ul>
{dede:channel type="son"}
<li><a href="[field:typeurl/]" title="[field:typename/]">[field:typename/]</a></li>
{/dede:channel}
</ul>
</li>
{/dede:channelartlist}
</ul>
前端效果
查看代碼發(fā)現(xiàn),即使沒有二級欄目,但這個(gè)列表代碼還存在。
經(jīng)DEDEHTML大神指點(diǎn),導(dǎo)航菜單用下面調(diào)用代碼就正常了。
{dede:channelartlist row=7 typeid=top currentstyle=current}
<li>
<a href="{dede:field name=typeid runphp=yes}global $dsql;$row = $dsql->GetOne("select * from `#@__arctype` where reid='@me' and ishidden<>1 order by sortrank asc limit 0,1");if(is_array($row)) @me = 'javascript:;'; else @me = GetOneTypeUrlA($dsql->GetOne("select * from `#@__arctype` where id='@me' and ishidden<>1"));{/dede:field}"><span>{dede:field.typename/}</span>{dede:channel type='son' row=1 noself='yes'}<i class="touch-arrow-down"></i>{/dede:channel}</a>
{dede:channel type='son' row=1 noself='yes'}
<ul>
{/dede:channel}
{dede:channel type='son' noself='yes'}
<li><a href="[field:typelink/]"><span>[field:typename/]</span></a></li>
{/dede:channel}
{dede:channel type='son' row=1 noself='yes'}
</ul>
{/dede:channel}
</li>
{/dede:channelartlist}
有二級欄目時(shí)一級欄目的Url輸出?javascript:;?只有一級欄目就輸出鏈接,效果如下:
]]>