方法一:
TS配置
temp.mypath=HMENU
temp.mypath.special=rootline
temp.mypath.includeNotInMenu = 1
#temp.mypath.special.range= 1 | -1
temp.mypath.wrap = <ul>|</ul>
temp.mypath.1=TMENU
temp.mypath.1{
#NO.allWrap= <li>|»</li>|*|<li>|»</li>|*|<li class=”current”>|</li>
NO.allWrap= <li>|></li>|*|<li>|></li>|*|<li class=”current”>|</li>
NO.doNotLinkIt=|*| |*| 1 #No Link in the last node
}
ts_navpath = COA
ts_navpath.10 < temp.mypath
方法二:
插件名:julle_navpath
主要代码:
function main($content,$conf) {
$rL = $GLOBALS[“TSFE”]->tmpl->rootLine;
// Prepare vars:
$linkArr = Array();
// Traverse menuitems:
$length = sizeof($rL);
$start = 0;
$end = $length;
for($i = $start;$i< $end;$i++) {
$pages_row = $rL[$i];
$linkArr[] = ‘<li>’.$this->pi_linkToPage(
$pages_row[“nav_title”]?$pages_row[“nav_title”]:$pages_row[“title”],
$pages_row[“uid”],
$pages_row[“target”]).'</lid>’;
}
//return ‘<ul ‘.$this->pi_classParam(“menu”).’ >’.implode(” > “,$linkArr).'</ul>’;
#ts_navpath = USER
#ts_navpath.userFunc = tx_jullenavpath_pi1->main
return ‘<ul>’.implode(” > “,$linkArr).'</ul>’;
}
################################
$rL = $GLOBALS[“TSFE”]->tmpl->rootLine;
// Prepare vars:
$linkArr = Array();
// Traverse menuitems:
for($i = 0;$i< count($rL);$i++) {
$linkArr[] = $rL[$i][“nav_title”]?$rL[$i][“nav_title”]:$rL[$i][“title”];
}
return “/”.implode(“/”,$linkArr);