<a href="{dede:field.typeurl/}" >{dede:field name='typename'/}</a>
<ul>
{dede:channel type=son noself=yes}
<!-- 二级 -->
<li>
<a href="[field:typeurl/]" title="[field:typename/]">[field:typename/]</a>
<ul>
<!-- 三级 -->
[field:id runphp=yes]
global $dsql;
$sql = "Select id,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath FROM `dede_arctype`
WHERE reid=@me And ishidden<>1 order by sortrank asc limit 0,10";
$dsql->SetQuery($sql);
$dsql->Execute('t');
$result = '';
while($row = $dsql->GetArray('t'))
{
$typename = $row['typename'];
$typeurl = GetOneTypeUrlA($row);
$result .= <<< TPL
<li><a href="{$typeurl}">{$typename}</a></li>
TPL;
}
@me = $result;
[/field:id]
</ul>
</li>
{/dede:channel}
</ul>
</li>
{/dede:channelartlist}
</ul>
上面的是输出到三级栏目,如果需要四级栏目可以这样写
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<!-- 三级/四级 -->
[field:id runphp=yes]
global $dsql;
$sql = "Select id,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath FROM `dede_arctype`
WHERE reid=@me And ishidden<>1 order by sortrank asc limit 0,10";
$dsql->SetQuery($sql);
$dsql->Execute('t');
$result = '';
while($row = $dsql->GetArray('t'))
{
$row['typeurl'] = GetOneTypeUrlA($row);
$result .= "<a href='{$row[typeurl]}'>{$row[typename]}</a>";
//四级