[*,[url=,{dede:field name='typename'/}[/url]
{dede:sql sql='Select * from dede_arctype where reid=~id~ ORDER BY id limit 0]7'}
[*,[url=[field:typedir/,,[field:typename/,[/url]
{/dede:sql}
[url=,{dede:field name='typename'/}[/url]
{dede:sql sql='Select * from dede_arctype where reid=~id~ ORDER BY id limit 0]7'}
[*,[url=[field:typedir/,,[field:typename/,[/url]
{/dede:sql}
{/dede:channelartlist}
主栏目调用
{dede:channelartlist typeid=top row=''}
[*,[url=,{dede:field name='typename'/}[/url]
{dede:sql sql='Select * from dede_arctype where reid=~id~ ORDER BY id limit 0]7'}
[field:array runphp='yes',@me = (!empty(@me['reid',) ? "" : "[*,[url={@me[,{@me['typename',}[/url]"); [/field:array,
{/dede:sql}
{/dede:channelartlist}
在列表页和内容页调用顶级栏目名称方法
{dede:field.typeid runphp='yes' function="GetTopid(@me)"}
$dsql = new DedeSql(false);
$a="SELECT typename FROM dedemuban_arctype where id=@me";
$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'}
[url=,[field:typename/,[/url]
{/dede:channel}
------------------------------
例如同时调用顶级栏目,全站文章和顶级栏目下的子栏目:
{dede:channel type='top' row='800'}
[url=[field:typelink/,,[field:typename/,[/url],1