當使用{dede:type typeid='4'}[field:typename/]{/dede:type} 標籤時,能夠獲得當前欄目的上一級欄目信息。
修改方法:
1、打開“站點根目錄\include\taglib\type.lib.php"文件。
2、修改代碼:紅色部分爲新添加的代碼。從代碼文件第31行開始。
$attlist='typeid|0,parent|0'; FillAttsDefault($ctag->CAttribute->Items,$attlist); extract($ctag->CAttribute->Items, EXTR_SKIP); $innertext = trim($ctag->GetInnerText()); if($typeid==0) { $typeid = ( isset($refObj->TypeLink->TypeInfos['id']) ? $refObj->TypeLink->TypeInfos['id'] : $envs['typeid'] ); } if(emptyempty($typeid)) return ''; $row = $dsql->GetOne("SELECT * FROM `cn_arctype` WHERE id='$typeid' "); if ($parent==1) $row = $dsql->GetOne("SELECT * FROM `cn_arctype` WHERE id='{$row['reid']}' ");
3、調用方法:
{dede:type typeid='3'parent='1'}[field:typename/]{/dede:type}