织梦Dedecms获取上级栏目名称及链接方法:直接上代码
{dede:field name='typeid' runphp='yes'}
global $dsql;
/*获取当前栏目信息*/
$typeid = @me;
$query = "SELECT reid FROM dede_arctype where id = $typeid";
$rs = $dsql->GetOne($query);
$reid = $rs['reid'];//获取到栏目的上级栏目
/*获取上级栏目信息*/
$query2 = "SELECT * FROM dede_arctype where id = $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}'>$typename</a>";
版权声明: 本站资源均来自互联网或会员发布,如果侵犯了您的权益请与我们联系,我们将在24小时内删除!谢谢!
转载请注明: 织梦Dedecms获取上级栏目名称及链接方法