原文来自:https://www.zixuephp.com
织梦调用当前栏目的上级栏目办法
- {dede:fieldname='typeid'runphp='yes'}
- global$dsql;
- $typeid=@me;
- $query="SELECTreidFROMdede_arctypewhereid=$typeid";
- $rs=$dsql->GetOne($query);
- $reid=$rs['reid'];//获取到栏目的上级栏目
- $query2="SELECT*FROMdede_arctypewhereid=$reid";
- $row=$dsql->GetOne($query2);
- $typename=$row['typename'];//上级栏目名称
- $link=GetTypeUrl($row['typeid'],MfTypedir($row['typedir']),$row['isdefault'],$row['defaultname'],$row['ispart'],$row['namerule2'],$row['moresite'],$row['siteurl'],$row['sitepath']);
- @me="<a==href='{$link}'>首页</a==>";