在 开发织梦模板的时候,在 调用 dede:channel 标签时,需要将 栏目中 seotitle中的 内容也可以调用出来。默认是不 支持调用的。岛主做了一下二次开发,让channel标签支持seotitle的调用。
打开 include/taglib/channel.lib.php,找到如下代码:
if($type=='top')
{
$sql = "SELECT id,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath
From `dede_arctype` WHERE reid=0 And ishidden<>1 order by sortrank asc limit 0, $line ";
}
else if($type=='son')
{
if($typeid==0) return '';
$sql = "SELECT id,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath
From `dede_arctype` WHERE reid='$typeid' And ishidden<>1 order by sortrank asc limit 0, $line ";
}
else if($type=='self')
{
if($reid==0) return '';
$sql = "SELECT id,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath
FROM `dede_arctype` WHERE reid='$reid' And ishidden<>1 order by sortrank asc limit 0, $line ";
}
|
if($type=='top')
{
$sql = "SELECT id,typename,seotitle,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath
From `dede_arctype` WHERE reid=0 And ishidden<>1 order by sortrank asc limit 0, $line ";
}
else if($type=='son')
{
if($typeid==0) return '';
$sql = "SELECT id,typename,seotitle,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath
From `dede_arctype` WHERE reid='$typeid' And ishidden<>1 order by sortrank asc limit 0, $line ";
}
else if($type=='self')
{
if($reid==0) return '';
$sql = "SELECT id,typename,seotitle,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath
FROM `dede_arctype` WHERE reid='$reid' And ishidden<>1 order by sortrank asc limit 0, $line ";
}
|
{dede:channel type='top' row='10'}
<li><a href='[field:typeurl/]'>[field:typename/]<br/>[field:seotitle/]</a></li>
{/dede:channel}
|
完成。
(责任编辑:admin) |