Trying to modify a function.
Posted: Wed Jun 13, 2007 2:21 pm
I'm trying -unsuccessfully so far- to modify this function so that only the parent link shows in the navigation, rather than the parent AND the current page (as it now does).
Can someone offer some help? Thanks.
Can someone offer some help? Thanks.
Code: Select all
function getCategoriesNavLine($parent=0, &$tree){
$l = $tree->collection[$parent]->level;
$pa = $tree->collection[$parent];
$nav = "";
for($i = $l; $i >= 1; $i--){
if(($i==0) || ($i>$l-4)){
$nav = '/ <a href="'.getCatalogUrl($pa->caption, $pa->id, 1).'">'.gs($pa->caption).'</a> '.($i<>$l?"":"").$nav;
}
else{
$nav = '.. / '.$nav;
}
if($i>0){
$pa = $tree->collection[$pa->parent_id];
}
}
return $nav;
}