首页 > 技术交流 > 织梦(dedecms)循环调用二级栏目下三级栏目
织梦(dedecms)循环调用二级栏目下三级栏目 2012-10-25

如果用以下代码的话,前台页面的显示将不太令人满意。对于有子类的二级目录,将会正确显示其子类,那些没有子类的 将显示其同类列表。

 {dede:channelartlist  typeid='7' }
                        <dl class="on">
                            <span><a href="#" class="icon"></a><a href="{dede:field name='typeurl'/}">
                                {dede:field name='typename'/}</a></span>
                           
                                  
                                    <dt>
                                        <ul> {dede:channel  row='10' type='son' }
                                            <li><a href="[field:typeurl/]" target="_blank">[field:typename/]</a></li>
                                            {/dede:channel}
                                            
                                        </ul>
                                    </dt>
                               
                        </dl>
                   
                      {/dede:channelartlist} 

 

接下来我们用第二种sql语句的方法:

{dede:channelartlist  typeid='7'  }
                        <li>
                            <h4>
                                <a target="_blank" href="{dede:field name='typeurl'/}">{dede:field name='typename'/}</a></h4>
                            <div>
                            {dede:sql sql='Select * from sjjc_arctype where reid=~id~ ORDER BY id'}
        <a target="_blank" href="[field:typelink/]">[field:typename/]</a>
                                {/dede:sql}
                                </div>
                        </li>
                       {/dede:channelartlist}

结果OK了,可对于第四级,第五级之类的就不知道如何操作了,哎,真是麻烦啊。

上一篇:dedecms幻灯片广告管理插件 下一篇:dedecms给内容文章列表添加hot,new等小图标