织梦调用当前栏目的上级栏目办法 – DeDecms


avatar
pcwnas 2023-04-21 191

原文来自:https://www.zixuephp.com

织梦调用当前栏目的上级栏目办法

  1. {dede:fieldname='typeid'runphp='yes'}
  2. global$dsql;
  3. $typeid=@me;
  4. $query="SELECTreidFROMdede_arctypewhereid=$typeid";
  5. $rs=$dsql->GetOne($query);
  6. $reid=$rs['reid'];//获取到栏目的上级栏目
  7. $query2="SELECT*FROMdede_arctypewhereid=$reid";
  8. $row=$dsql->GetOne($query2);
  9. $typename=$row['typename'];//上级栏目名称
  10. $link=GetTypeUrl($row['typeid'],MfTypedir($row['typedir']),$row['isdefault'],$row['defaultname'],$row['ispart'],$row['namerule2'],$row['moresite'],$row['siteurl'],$row['sitepath']);
  11. @me="<a==href='{$link}'>首页</a==>";