当前位置:DedeCMS.org>DedeCms教程>

取消导航栏隐藏所在栏目名称

来源:dedecms论坛 作者:kofkof 发布时间:2007-10-11 点击次数:

include/inc_typelink.php
第290-305行
找到:

           //处理同级栏目中,当前栏目的样式
        if($typetype=="self" && $row['ID']=="$typeid"){
          if($myinnertext!=''){
              $linkOkstr = $myinnertext;
              $row['typelink'] = $this->GetOneTypeUrl($row);
              $linkOkstr = str_replace("~typelink~",$row['typelink'],$linkOkstr);
              $linkOkstr = str_replace("~typename~",$row['typename'],$linkOkstr);
              $likeType .= $linkOkstr;
          }
        }else{//非当前栏目
          $row['typelink'] = $this->GetOneTypeUrl($row);
          if(is_array($dtp2->CTags)){
              foreach($dtp2->CTags as $tagid=>$ctag)
              { if(isset($row[$ctag->GetName()])) $dtp2->Assign($tagid,$row[$ctag->GetName()]); }
          }
          $likeType .= $dtp2->GetResult();
        }

替换为以下代码:

    if($typetype=="self" or $typetype=="top" or $typetype=="sun" or $typetype=="son") {//非当前栏目
          $row['typelink'] = $this->GetOneTypeUrl($row);
          if(is_array($dtp2->CTags)){
              foreach($dtp2->CTags as $tagid=>$ctag)
              { if(isset($row[$ctag->GetName()])) $dtp2->Assign($tagid,$row[$ctag->GetName()]); }
          }
          $likeType .= $dtp2->GetResult();
        }