dedeCMS5.7在任意栏目获取顶级栏目名称及链接的方法


{dede:field.typeid runphp="yes"}$ID = @me; $sql = "SELECT * FROM `dede_arctype` WHERE id=$ID";$query = mysql_query($sql);$row=mysql_fetch_array($query); $relID = "$row[reid]"; if($relID == 0)  = "<a href="".$row["typedir"]."">".$row["typename"]."</a>";$url=$cfg_basehost.$cfg_cmspath;@me=str_replace("{cmspath}",$url,@me);}else{$sql = "SELECT * FROM `dede_arctype` WHERE id=$relID";$query = mysql_query($sql);$row=mysql_fetch_array($query); @me = "<a href="".$row["typedir"]."">".$row["typename"]."</a>";$url=$cfg_basehost.$cfg_cmspath;@me=str_replace("{cmspath}",$url,@me);}{/dede:field.typeid}


net65090.gif

你可能感兴趣的:(dedecms,链接,织梦,栏目名称)