织梦DedeCMS栏目页和内容页调用二级、三级栏目
先来看看效果
实现教程
1、打开 includetaglibchannelartlist.lib.php 找到
$tpsql = " reid='$typeid' AND ispart<>2 AND ishidden<>1 ";
改成
if($type=='son')
{
$typeid = ( !empty($refObj->TypeLink->TypeInfos['id']) ? GetTopid($refObj->TypeLink->TypeInfos['id']) : 0 );
$tpsql = " reid='$typeid' AND ishidden<>1 ";
}
else
{
$tpsql = " reid='$typeid' AND ispart<>2 AND ishidden<>1 ";
}
2、打开 includetaglibchannel.lib.php 找到
if($type=='son' && $reid!=0 && $totalRow==0)
改成
if($type=='son' && $reid!=0 && $totalRow==0 && $noself=='')
3、后台-系统-其它选项 去掉php
4、列表页和内容页标签写法
-
{dede:php}
$GLOBALS['thisid'] = intval($refObj->Fields['typeid']);
$GLOBALS['reid'] = intval($refObj->Fields['reid']);
$GLOBALS['topid'] = intval($refObj->Fields['topid']);
{/dede:php}
{dede:channelartlist type=son}
<li{dede:field.typeid runphp=yes}(@me==$GLOBALS['thisid']||@me==$GLOBALS['reid']||@me==$GLOBALS['topid'])? @me=' class="current"':@me='';{/dede:field.typeid}>{dede:field.typename/}
-
{dede:channel type=son noself=yes}
<lifield:id runphp=yes? @me=' class="current2"':@me='';[/field:id]>[field:typename/]
{/dede:channel}
{/dede:channelartlist}
完成。
添加新评论