当前栏目调用上级栏目名称的办法
问题:网站需要在栏目列表页调用上级栏目的名称,也就是在列表模板调用当前栏目的父栏目?
解答:
动态页:
03 |
$tsql = new DedeSql( false ); |
05 |
$tsql->SetQuery( "Select i.typedir,i.id,i.typename From arctype t left join arctype i on i.id=t.reid where t.id='@me'" ); |
07 |
while ($row = $tsql->GetArray( 't' ,MYSQL_ASSOC)) |
09 |
$typelink2 .= "<a href='list.php?tid=" .$row[' id ']."' >".$row[ 'typename' ]. "</a>" ; |
|
静态页:
03 |
$tsql = new DedeSql( false ); |
05 |
$tsql->SetQuery( "Select i.typedir,i.id,i.typename From arctype t left join arctype i on i.id=t.reid where t.id='@me'" ); |
07 |
while ($row = $tsql->GetArray( 't' ,MYSQL_ASSOC)) |
09 |
$typelink2 .= "<a href='" .$row['typedir ']."' >".$row[ 'typename' ]. "</a>" ; |
11 |
@me=str_replace( "{cmspath}" , "" ,$typelink2); |
|
本文链接:http://www.365ymw.com/article-1421.html 转载请保留出处,谢谢!
中查找“当前栏目调用上级栏目名称的办法”更多相关内容!