怎么在首页调用dede子栏目【mysql版】织梦技巧
导读:织梦技巧织梦技巧{dede:channelartlist typeid=栏目ID row=条数} div class=list lia href={dede:field nam个业网站建设公司网seo优化趋势。
{dede:channelartlist typeid=栏目ID row=条数} div class=list lia href={dede:field name=typeurl/}{dede:field name=typename/}/a/li ul {dede:sql sql=Select * from dede_arctype where reid=~id~ ORDER BY id limit 0,7} lia href=[field:typedir/] […]
{dede:channelartlist typeid='栏目ID' row='条数'} <div class="list"> <li><a href="{dede:field name=网站seo优化培训39;typeurl'/}">{dede:field name='typename'/}</a></li> <ul> {dede:sql sql='Select * from dede_arctype where reid=~id~ ORDER BY id limit 0,7'} <li><a href='[field:typedir/]' target='_blank'>[field:typename/]</a></li> {/dede:sql} </ul> </div> {/dede:channelartlist} 代码功能:父栏目及子栏目同时调用 使用说明……typeid,row 如果[field:typedir/]中含有{cmspath}而使链接无效,请使用[field:typedir function='str_replace("{cmspath}","",@me)'/] 此标签替换[field:typedir/]。 {dede:field name='typedir' runphp='yes'} @me=str_replace("{cmspath}","",@me); {/dede:field} 一、二、三级栏目调用 {dede:channelartlist typeid=top row=4} <div class="cpmll"> <span><a href="{dede:field name='typeurl'/}">{dede:field name='typename'/}</a></span> <ul> {dede:sql sql='Select * from dede_arctype where reid=~id~ ORDER BY id limit 0,7'} <li><a href='[field:typedir/]' targeseo网站优化t='_blank'>[field:typename/]</a></li> {/dede:sql} </ul> </div> {/dede:channelartlist} 主栏目调用 {dede:channelartlist typeid=top row=''} <li><a href="{dede:field name='typeurl'/}">{dede:field name='typename'/}</a> <ul> {dede:sql sql='Select * from dede_arctype where reid=~id~ ORDER BY id limit 0,7'} [field:array runphp='yes']@me = (!empty(@me['reid']) ? "" : "<li><a href='{@me['typedir']}' target='_blank'>{@me['typename']}</a></li>"); [/field:array] {/dede:sql} </ul> </li> {/dede:channelartlist} 在列表页和内容页调用顶级栏目名称方法 {dede:field.typeid runphp='yes' function="GetTopid(@me)"} $dsql = new DedeSql(false); $a="SELECT typename FROM dedemuban_arctype where id=@me"网站优化seo培训;; $arcRow = $dsql->GetOne($a); @me=$arcRow[typename];{/dede:field.typeid} 根据下级栏目获得顶级栏目名称的SQL语句 {dede:field.typeid runphp='yes'} $ID = @me; $sql = "SELECT * FROM `dede_arctype` WHERE id=$ID"; $query = mysql_query($sql);$row=mysql_fetch_array($query); $relID = "$row[reid]"; if($relID == 0) { @me = $row[typename]; } else{ $sql = "SELECT `typename` FROM `dede_arctype` WHERE id=$relID"; $query = mysql_query($sql); $row=mysql_fetch_array($query); @me = $row[typename]; } {/dede:field.typeid} 怎么在首页调用dede子栏目 {dede:channel type='son' typeid='栏目ID'} <a href="[field:typelink/]">[field:typename/]</a> {/dede:channel} 例如同时调用顶级栏目,全站文章和顶级栏目下的子栏目: {dede:channel type='top' row='800'} <a href='[field:typelink/]'>[field:typename/]</a>,1<br /> {/dede:channel} {dede:arclist row='80000' titlelen='40' orderby='pubdate' idlist=''} [field:textlink/],1<br/> {/dede:arclist} {dede:channelartlist row='3000'} <a href="{dede:field name='typeurl'/}">{dede:field name='typename'/}</a><br /> <ul> {dede:sql sql='Select * from dede_arctype where reid=~id~ ORDER BY id limit 0,3000'} <a href='[field:typedir/]' target='_blank'>[field:typename/]</a>,1<br /> {/dede:sql} </ul>声明: 本文由我的SEOUC技术文章主页发布于:2023-05-26 ,文章怎么在首页调用dede子栏目【mysql版】织梦技巧主要讲述首页,栏目,怎么在首页调用dede子栏目【mysql版】织网站建设源码以及服务器配置搭建相关技术文章。转载请保留链接: https://www.seouc.com/article/web_9171.html