• 全国400电话网上服务平台
    强大号码库资源任选,方便,快捷,快速开通。
    咨询热线:400-1100-266  

    织梦调用父级栏目链接和名称
    POST TIME:2017-11-13 00:04
    打开文件

    /include/taglib/channel.lib.php

    找到代码

    else if($type=='self')
    {
    if($reid==0) return '';
    $sql = "SELECT id,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath
    FROM `dede_arctype` WHERE reid='$reid' And ishidden<>1 order by sortrank asc limit 0, $line ";
    }

    在其后添加

    else if($type=='topone')
    {
    if($reid==0) return '';
    $rowR = $dsql->GetOne("SELECT * FROM `dede_arctype` WHERE id='$typeid' ");
    $topids = $rowR['topid'];
    $sql = "SELECT id,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath
    FROM `dede_arctype` WHERE reid='0' And id='$topids' And ishidden<>1 order by sortrank asc limit 0, $line ";
    }
    else if($type=='fatherlist')
    {
    $rowR = $dsql->GetOne("SELECT * FROM `dede_arctype` WHERE id='$typeid' ");
    $reid = $rowR['reid'];
    $rowR = $dsql->GetOne("SELECT * FROM `dede_arctype` WHERE id='$reid' ");
    $reid = $rowR['reid'];
    $sql = "SELECT id,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath
    FROM `dede_arctype` WHERE reid='$reid' And ishidden<>1 order by sortrank asc limit 0, $line ";
    }

    然后就可以在模板中调用父级栏目和父级顶级栏目了:

    {dede:channel type='fatherlist'}[field:typename/]{/dede:channel}


    {dede:channel type='topone'}[field:typename/]{/dede:channel}

    
    Copyright © 2003-2016
    时间:9:00-21:00 (节假日不休)
    版权所有:巨人网络(扬州)科技有限公司
    总部地址:江苏省信息产业基地11号楼四层
    《增值电信业务经营许可证》 苏B2-20120278
    X

    截屏,微信识别二维码

    微信号:veteran88

    (点击微信号复制,添加好友)

     打开微信

    微信号已复制,请打开微信添加咨询详情!