<var id="xvh3p"><noframes id="xvh3p"><var id="xvh3p"></var><listing id="xvh3p"><strike id="xvh3p"><listing id="xvh3p"></listing></strike></listing>
<var id="xvh3p"><strike id="xvh3p"><var id="xvh3p"></var></strike></var><th id="xvh3p"><strike id="xvh3p"><th id="xvh3p"></th></strike></th>
<span id="xvh3p"><noframes id="xvh3p"><dl id="xvh3p"></dl>
<span id="xvh3p"><noframes id="xvh3p">
<dl id="xvh3p"><noframes id="xvh3p">
<listing id="xvh3p"><noframes id="xvh3p"><listing id="xvh3p"><strike id="xvh3p"><listing id="xvh3p"></listing></strike></listing><th id="xvh3p"><strike id="xvh3p"><th id="xvh3p"></th></strike></th>
<th id="xvh3p"><strike id="xvh3p"></strike></th>
<dl id="xvh3p"><noframes id="xvh3p">
<th id="xvh3p"><noframes id="xvh3p">

观点

互联网+时代,说建站,谈运营与网络营销

当前栏目调用上级栏目名称的办法

时间:2020-12-15

问题:网站需要在栏目列表页调用上级栏目的名称,也就是在列表模板调用当前栏目的父栏目?

解答:

动态页:
复制代码{dede:type}
[field:id runphp=yes]
    $tsql = new DedeSql(false);
    $typelink2 = '';
    $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'");
    $tsql->Execute('t');
    while($row = $tsql->GetArray('t',MYSQL_ASSOC))
    {
       $typelink2 .= "<a href='list.php?tid=".$row['id']."'>".$row['typename']."</a>";
    }
    @me=$typelink2;
[/field:id]
{/dede:type}



静态页
复制代码{dede:type}
[field:id runphp=yes]
    $tsql = new DedeSql(false);
    $typelink2 = '';
    $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'");
    $tsql->Execute('t');
    while($row = $tsql->GetArray('t',MYSQL_ASSOC))
    {
       $typelink2 .= "<a href='".$row['typedir']."'>".$row['typename']."</a>";
    }
    @me=str_replace("{cmspath}","",$typelink2);
[/field:id]
{/dede:type}

0
首页
案例
关于
联系