在织梦 /include/extend.func.php 文件页面底部添加一下代码: function display_ul($i,$var='0'){ global $dsql; $row = $dsql-GetOne("SELECT COUNT(id) as num FROM dede_arctype WHERE reid = $i)"); if($row['num']0 ){ if($var=='0'){ return "ul"; }else{ return […]
在织梦/include/extend.func.php
文件页面底部添加一下代码:
function display_ul($i,$var='0'){
global $dsql;
$row = $dsql->GetOne("SELECT COUNT(id) as num FROM dede_arctype WHERE reid = $i)");
if($row['num']>0 ){
if($var=='0'){
return "<ul>";
}else{
return "</ul>";
}
}
}
{dede:channelartlist row=7 typeid=top currentstyle=current}
<li>
<a href="{dede:field.typeurl/}">{dede:field.typename/}</a>
{dede:field.id function='display_ul(@me)'/}
<!-- 二级栏目 -->
{dede:channel type=son noself=yes}
<li>
<a href="[field:typelink/]">[field:typename/]</a>
</li>
{/dede:channel}
{dede:field.id function='display_ul(@me,1)'/}
</li>
{/dede:channelartlist}
//输出对应<ul>标签
{dede:field.id function='display_ul(@me)'/}
//输出对应<ul/>标签
{dede:field.id function='display_ul(@me,1)'/}