Die Breadcrumb soll ab $category_id = 10 angezeigt werden. Angezeigt wird jedoch der komplette Pfad - so als würde category_id = 0 der Funktion übergeben werden.
Code: Alles auswählen
$nav->getBreadcrumb(TRUE, TRUE, 10);
Code: Alles auswählen
$category_id = 10;
$depth = 3;
$open = TRUE;
$ignore_offlines = TRUE;
$navigation = $nav->get($category_id, $depth, $open, $ignore_offlines);
An welcher Stelle in der function wird eigentlich der Parameter $category_id verarbeitet?
Habe ich etwas übersehen?
Code: Alles auswählen
function getBreadcrumb($startPageLabel, $includeCurrent = false, $category_id = 0)
{
if (!$this->_setActivePath()) {
return false;
}
global $REX;
$path = $this->path;
$i = 1;
$lis = '';
if ($startPageLabel) {
$lis .= '<li class="rex-lvl' . $i . '"><a href="' . rex_getUrl($REX['START_ARTICLE_ID']) . '">' . htmlspecialchars($startPageLabel) . '</a></li>';
$i++;
// StartArticle nicht doppelt anzeigen
if (isset($path[0]) && $path[0] == $REX['START_ARTICLE_ID']) {
unset($path[0]);
}
}
foreach ($path as $pathItem) {
$cat = OOCategory::getCategoryById($pathItem);
$lis .= '<li class="rex-lvl' . $i . '"><a href="' . $cat->getUrl() . '">' . htmlspecialchars($cat->getName()) . '</a></li>';
$i++;
}
if ($includeCurrent) {
if ($art = OOArticle::getArticleById($this->current_article_id)) {
if (!$art->isStartpage()) {
$lis .= '<li class="rex-lvl' . $i . '">' . htmlspecialchars($art->getName()) . '</li>';
} else {
$cat = OOCategory::getCategoryById($this->current_article_id);
$lis .= '<li class="rex-lvl' . $i . '">' . htmlspecialchars($cat->getName()) . '</li>';
}
}
}
return '<ul class="rex-breadcrumb">' . $lis . '</ul>';
}