增加channel标签的type父栏目调用并支持currentstyle
2014-03-28 14:18
501 查看
问题描述:增加channel标签的type父栏目调用并支持currentstyle
解决方法:\include\taglib\channel.lib.php
1、在这段代码后(大概91-96行)
else if($type=='self')
{
if($reid==0) return '';
$sql = "SELECT id,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath
FROM `#@__arctype` WHERE reid='$reid' And ishidden<>1 order by sortrank asc limit $limit, $line ";
}
增加
// 新增代码以支持parent参数,修改By:米易工作室 Q:8485405 www.miyinet.tk
else if($type=='parent')
{
if($topid==0) return '';
$sql = "SELECT id,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath
FROM `#@__arctype` WHERE reid='$topid' And ishidden<>1 order by sortrank asc limit $limit, $line ";
}
// 新增代码结束结束
2、然后修改以下代码(大概143行):
if( ( $row['id']== $refObj->TypeLink->TypeInfos['id'] || ($topid==$row['id'] && $type=='top')) && $currentstyle!='' )
改为:
if( ( $row['id']== $refObj->TypeLink->TypeInfos['id'] || ($topid==$row['id'] && $type=='top') || ($reid==$row['id'] && $type=='parent')) && $currentstyle!='' )
//此处增加了 || ($reid==$row['id'] && $type=='parent')这段用于判断parent时的当前栏目
经过2个步骤的修改
可以实现2个功能:
1、调用父级栏目(上级),对于栏目分级太深的很有用
方法:
{dede:channel type='parent'}{dede:channel}
2、可以调用currentstyle,对于栏目分级太深,还想改变当前栏目样式的很有用!
解决方法:\include\taglib\channel.lib.php
1、在这段代码后(大概91-96行)
else if($type=='self')
{
if($reid==0) return '';
$sql = "SELECT id,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath
FROM `#@__arctype` WHERE reid='$reid' And ishidden<>1 order by sortrank asc limit $limit, $line ";
}
增加
// 新增代码以支持parent参数,修改By:米易工作室 Q:8485405 www.miyinet.tk
else if($type=='parent')
{
if($topid==0) return '';
$sql = "SELECT id,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath
FROM `#@__arctype` WHERE reid='$topid' And ishidden<>1 order by sortrank asc limit $limit, $line ";
}
// 新增代码结束结束
2、然后修改以下代码(大概143行):
if( ( $row['id']== $refObj->TypeLink->TypeInfos['id'] || ($topid==$row['id'] && $type=='top')) && $currentstyle!='' )
改为:
if( ( $row['id']== $refObj->TypeLink->TypeInfos['id'] || ($topid==$row['id'] && $type=='top') || ($reid==$row['id'] && $type=='parent')) && $currentstyle!='' )
//此处增加了 || ($reid==$row['id'] && $type=='parent')这段用于判断parent时的当前栏目
经过2个步骤的修改
可以实现2个功能:
1、调用父级栏目(上级),对于栏目分级太深的很有用
方法:
{dede:channel type='parent'}{dede:channel}
2、可以调用currentstyle,对于栏目分级太深,还想改变当前栏目样式的很有用!
相关文章推荐
- 织梦channel 频道标签currentstyle当前栏目高亮,无法应用于type=sun或son子分类中
- dede让channelartlist标签支持currentstyle属性 完美解决
- dede让channelartlist标签支持currentstyle属性
- dede让channelartlist标签支持currentstyle属性
- dede让channelartlist标签支持currentstyle属性 完美解决
- 让织梦dedecms中{dede:type}标签支持调用父级栏目名称
- 织梦搜索结果增加dede:type、dede:arclist、dede:channelartlist、dede:tag等标签支持
- dede让channelartlist标签支持currentstyle属性 完美解决
- dede让channelartlist标签支持currentstyle属性 完美解决
- dede让channelartlist标签支持currentstyle属性 完美解决
- dede让channelartlist标签支持currentstyle属性 完美解决
- channelartlist标签不能调用外部链接栏目的解决办法
- dedecms channelartlist标签支持currentstyle属性 完美解决
- 织梦标签channel实现列表页调用当前栏目的子类
- 织梦channel标签currentstyle样式无效不起作用的解决办法
- 织梦DEDECMS中增加父栏目调用,以及多级支持currentstyle的方法
- dede频道标签channel和频道内容标签channelartlist的调用栏目名的不同方式,如果错误使用标签会发生错误
- 梦dedecms中调用栏目currentstyle样式的用法
- channelartlist 支持currentstyle属性
- 在channel标签中使用currentstyle中,不能输出自定义新变量