ich versuche eine 3er Navi einzubauen und habe dafür aus der Demo das Template ID 2 hergenommen. Nur leider stehe ich auf dem Schlauch und komme nicht weiter. Kann mir von euch jemand helfen? Wo mache ich die Fehler? Schon mal ganz lieben Dank vorab!
Liebe Grüße
Sindy
Hier mein geänderter Code:
Code: Alles auswählen
<?php
// EXPLODE PATH
$PATH = explode("|",$this->getValue("path").$this->getValue("article_id")."|");
// GET CURRENTS
$path1 = (isset ($PATH[1])) ? $PATH[1] : '';
$path2 = (isset ($PATH[2])) ? $PATH[2] : '';
$path3 = (isset ($PATH[3])) ? $PATH[3] : '';
$sitePath = '';
$titlePath = '';
$navLeftCol = '';
/* START 1st level categories */
$navHeader .= '<ul>';
$navLeftCol .= '<div id="navheight_horiz_vert">';
foreach (OOCategory::getRootCategories() as $lev1) {
if ($lev1->isOnline()):
if ($lev1->getId() == $path1) {
$navHeader .= '<li><a class="current" href="'.$lev1->getUrl().'">'.$lev1->getName().'</a>';
if ($lev1->getId() != "1") {
$sitePath .= ' ›› <a href="'.$lev1->getUrl().'">'.$lev1->getName().'</a>';
}
$titlePath .= ' >> '.$lev1->getName();
}
// 2nd level - no active link
// 3nd level - no active link
else {
$navHeader .= '<li><a href="'.$lev1->getUrl().'">'.$lev1->getName().'</a>';
}
// 1st level had categories? -> go on
$lev1Size = sizeof($lev1->getChildren());
if ($lev1->getId() == $path1) {
if ($lev1Size != "0"):
$navLeftCol .= '<ul class="nav1st">';
$navLeftCol .= '<li>'.$lev1->getName();
$navLeftCol .= '<ul class="nav2nd">';
$navLeftCol .= '<ul class="nav3nd">';
// START 2nd level categories
foreach ($lev1->getChildren() as $lev2):
if ($lev2->isOnline()):
// 2nd level - active link
if ($lev2->getId() == $path2) {
$navLeftCol .= '<li class="active"><a href="'.$lev2->getUrl().'">'.$lev2->getName().'</a></li>';
$sitePath .= ' ›› <a href="'.$lev2->getUrl().'">'.$lev2->getName().'</a>';
$titlePath .= ' >> '.$lev2->getName();
}
// 2nd level - no active link
else {
$navLeftCol .= '<li><a href="'.$lev2->getUrl().'">'.$lev2->getName().'</a></li>';
}
endif;
endforeach;
// END 2nd level categories
// START 3nd level categories
foreach ($lev2->getChildren() as $lev3):
if ($lev3->isOnline()):
// 3nd level - active link
if ($lev3->getId() == $path3) {
$navLeftCol .= '<li class="active"><a href="'.$lev3->getUrl().'">'.$lev3->getName().'</a></li>';
$sitePath .= ' ›› <a href="'.$lev3->getUrl().'">'.$lev3->getName().'</a>';
$titlePath .= ' >> '.$lev3->getName();
}
// 3nd level - no active link
else {
$navLeftCol .= '<li><a href="'.$lev3->getUrl().'">'.$lev3->getName().'</a></li>';
}
endif;
endforeach;
// END 3nd level categories
$navLeftCol .= '</ul>';
$navLeftCol .= '</li></ul>';
endif; // END by if ($lev1Size != "0"):
}
$navHeader .= '</li>';
endif; // END by if ($lev1->isOnline())
}
$navHeader .= '</ul>';
$navLeftCol .= '</div>';
// END 1st level categories
?>