<var id="xvh3p"><noframes id="xvh3p"><var id="xvh3p"></var><listing id="xvh3p"><strike id="xvh3p"><listing id="xvh3p"></listing></strike></listing>
<var id="xvh3p"><strike id="xvh3p"><var id="xvh3p"></var></strike></var><th id="xvh3p"><strike id="xvh3p"><th id="xvh3p"></th></strike></th>
<span id="xvh3p"><noframes id="xvh3p"><dl id="xvh3p"></dl>
<span id="xvh3p"><noframes id="xvh3p">
<dl id="xvh3p"><noframes id="xvh3p">
<listing id="xvh3p"><noframes id="xvh3p"><listing id="xvh3p"><strike id="xvh3p"><listing id="xvh3p"></listing></strike></listing><th id="xvh3p"><strike id="xvh3p"><th id="xvh3p"></th></strike></th>
<th id="xvh3p"><strike id="xvh3p"></strike></th>
<dl id="xvh3p"><noframes id="xvh3p">
<th id="xvh3p"><noframes id="xvh3p">

观点

互联网+时代,说建站,谈运营与网络营销

织梦(dedecms)循环调用多级子栏目如二级栏目下三级栏目

时间:2020-12-15

本文是关于织梦DedeCMS调用多级子栏目的,拿来分享下。 
后台已经建好栏目,对于产品展示栏 栏目导航如下图所示: 
 

复制代码
代码如下:

{dede:channelartlist cacheid='channelsonlist' typeid=3 } 
<dd> 
<dl> 
<dt><a href="{dede:field name='typeurl'/}">{dede:field name='typename'/}</a></dt> 
<dd> 
<ul> 
{dede:channel type='sun' row='10' noself='yes'} 
<li>&middot;&nbsp;<a href="[field:typeurl/]">[field:typename/]</a></li> 
{/dede:channel} 
</ul> 
</dd> 
</dl> 
</dd> 
{/dede:channelartlist} 

如果用以上代码的话,前台页面的显示将不太令人满意。对于有子类的二级目录,将会正确显示其子类,那些没有子类的 将显示其同类列表。如下图所示。 
 
这样的结果着实另人费解。 
接下来看第二种代码写法如下: 

复制代码
代码如下:

{dede:channelartlist typeid=3 } 
<dd> 
<dl> 
<dt><a href="{dede:field name='typeurl'/}">{dede:field name='typename'/}</a></dt> 
<dd> 
<ul> 
{dede:sql sql='Select * from `lzz_arctype` where reid=~id~ ORDER BY id'} 
<li>&middot;&nbsp;<a href="[field:typedir function="cn_substr(@me,200,9) " /]">[field:typename/]</a></li> 
{/dede:sql} 
</ul> 
</dd> 
</dl> 
</dd> 
{/dede:channelartlist} 

注:lzz_arctype这个是因为我把表名前缀改为lzz_了。 
结果呢,当然应该会是你想要的了,如下图。 
0
首页
案例
关于
联系