habe ein Navigationsmodul vom Downloadbereich eingebunden, dass wirklich super funktioniert. Jetzt möchte ich es aber gerne so, dass beim wiederholten Klick auf die Hauptkategorie sich diese im Navimenü wieder schliesst.
Hier der Code vom Modul:
- Code: Alles auswählen
<?function NavigationsListe(&$navLeftCol ,$lev,$Path,$PathIndex)
{
if(! $lev->isOnline()) // offline ausblenden
return;
$time = time();
// Falls zur Zeit nicht online --> ausblenden
if(($lev->getValue("online_from") > $time) || ($lev->getValue("online_to") < $time))
return;
if ($lev->getId() == $Path[$PathIndex]) // Eintrag ist im aktuellen Pfad, also selbst oder Subkategorie aktiv
{
$levSize = sizeof($lev->getChildren());
if($levSize != "0") // es gibt Kinder
{
if((count($Path) > $PathIndex) &&($Path[$PathIndex + 1] > 0))
{
// History $lev
$navLeftCol .= '<li class="navhistory"><a class="level'.$PathIndex.'" href="'.$lev->getUrl().'">'.$lev->getName().'</a></li>';
}
else
{
// aktiv $lev // wir sind aktiv
$navLeftCol .= '<li class="active"><a class="level'.$PathIndex.'" href="'.$lev->getUrl().'">'.$lev->getName().'</a></li>';
}
// die Kinder noch anzeigen
foreach($lev->getChildren() as $sublevel) // Subebene normal anzeigen
{
NavigationsListe($navLeftCol,$sublevel,$Path,$PathIndex + 1);
}
}
else
{
// aktiv $lev
$navLeftCol .= '<li class="active"><a class="level'.$PathIndex.'" href="'.$lev->getUrl().'">'.$lev->getName().'</a></li>';
return;
}
}
else
{
if(
// 1 || // alle Ebenen anzeigen
($PathIndex == 1) || // Top Level anzeigen
((count($Path) > $PathIndex) && ($Path[$PathIndex + 1] == 0)) //unterste Ebene anzeigen
)
{
// normal $lev
$navLeftCol .= '<li><a class="level'.$PathIndex.'" href="'.$lev->getUrl().'">'.$lev->getName().'</a></li>';
}
}
}
/* START 1st level categories */
$Path = explode("|",$this->getValue("path").$this->getValue("article_id")."|");
$navLeftCol .= '<ul ID="nav" class="nav1st">'; // die ID #nav ist nur für das javascript für den IE wichtig.
foreach (OOCategory::getRootCategories() as $lev1)
{
NavigationsListe($navLeftCol,$lev1,$Path,1);
}
$navLeftCol .= '</ul>';
?>
Und hier das CSS:
- Code: Alles auswählen
#navigation {
float:left;
width:170px;
height:auto;
max-height:auto;
}
#navigation ul.nav1st {
position:inherit;
}
#navigation ul.nav1st a{
display:block;
font-weight:bold;
}
#navigation ul.nav1st a.level1,
#navigation ul.nav1st a.current1{
padding-left:1.0em;
background-color:#666666;
background: url(navbild1.png) 0% 50% no-repeat;
line-height:30px;
font-size:14px;
}
#navigation ul.nav1st a.level2,
#navigation ul.nav1st a.current2{
padding-left:2.0em;
background-color:#7D7D7D;
line-height:15px;
font-size:12px;
}
#navigation ul.nav1st a.level3,
#navigation ul.nav1st a.current3{
padding-left:3.0em;
line-height:15px;
font-size:11px;
background-color:#999999;
}
#navigation ul.nav1st a.level4,
#navigation ul.nav1st a.current4{
padding-left:4.0em;
line-height:15px;
font-size:10px;
background-color:#7D7D7D;
}
#navigation ul.nav1st a.level5,
#navigation ul.nav1st a.current5{
padding-left:5.0em;
line-height:15px;
font-size:9px;
background-color:#7D7D7D;
}
#navigation ul.nav1st li,
#navigation ul.nav1st li.navhistory1,
#navigation ul.nav1st li.navhistory2,
#navigation ul.nav1st li.navhistory3,
#navigation ul.nav1st li.navhistory4,
#navigation ul.nav1st li.navhistory5,
#navigation ul.nav1st li.navhistory {
padding:0px 0px 0px 0px;
}
#navigation ul.nav1st li.active {
padding:0px 0px 0px 0px;
}
#navigation ul.nav1st li.active a,
#navigation ul.nav1st li.active a:link,
#navigation ul.nav1st li.active a:active
#navigation ul.nav1st li.active a:focus {
color:#FFFF00;
}
#navigation ul.nav1st a:hover {
color:#FFFF00;
}
#navigation ul.nav1st a:visited {
color:#990000;}
Es müsste doch gehen, die gewünschte Funktion hier einzubauen ?
Liebe Grüße und ein gutes neues Jahr
wienboy

