Hallo,
ich kriege die Subnavigation nicht dazu mir meinen Startartikel anzuzeigen! d.h. den aller ersten Artikel in Subnavigation aufzulisten, der ja auch angezeigt wird, wenn ich auf einen Eintrag der Hauptnavigation klicke. Wähle ich jetzt einen weiteren Artikel aus der Subnavigation komme ich nur durch Klick auf die Hauptnavigation wieder zum ersten (Start)-Artikel zurück.
Aber hier erstmal ein Link zum gucken:
http://www.en12831.net/index.php
Ich bin folgerndermaßen vorgegangen:
Das Template "01 01Navigation" aus der Demo aufgeteilt in
ein Template "Navigation menu" und ein "Navigation Sidebar"
Der Code für Sidebar sieht so aus:
- Code: Alles auswählen
<?php
// PFAD AUSLESEN
$cat_id = $this->getValue("category_id");
$path = explode("-",$this->getValue("path"));
//$showpath = "/ <a href=index.php?article_id=8 class=white>Home</a>";
$cat1 = current($path)+0;
next($path);
$cat2 = current($path)+0;
next($path);
$cat3 = current($path)+0;
// 2. NAVI (SubNavigation)
//global $NAV2 ;
$NAV2 = "<ul>";
$cat_id = $cat2;
@include $REX[INCLUDE_PATH]."/generated/categories/$cat_id.list.category";
$NAV = $REX[RECAT][$cat_id];
for ($i=0;$i<count($NAV);$i++)
{
$id = current($NAV);
$aid = $REX[CAT][$id][article_id];
$name = $REX[CAT][$id][name];
if ($i==0) $NAV2 .= "";
@include $REX[INCLUDE_PATH]."/generated/articles/$aid.article";
if ($cat3==$id and $REX[CAT][$id][status]==1)
//selected navbaritem
{
$NAV2 .= "<li>".
"<a href=index.php?article_id=$aid class=nava>$name</a></li>";
}elseif ($REX[CAT][$id][status]==1)
{
if ($name == "")
// no navbaritem (placeholder)
{
$NAV2 .= "<li> </li>";
}else
// Not selected navbaritem
{
$NAV2 .= "<li><a href=index.php?article_id=$aid class=nav>$name</a></li>";
}
}
if (($i+1)==count($NAV)) $NAV2 .= "</ul>";
next($NAV);
}
echo $NAV2;
?>
Und der Code für "Menu" so:
- Code: Alles auswählen
<?php
// PFAD AUSLESEN
$cat_id = $this->getValue("category_id");
$path = explode("-",$this->getValue("path"));
$showpath = "/ <a href=index.php?article_id=8 class=white>Home</a>";
$cat1 = current($path)+0;
next($path);
$cat2 = current($path)+0;
next($path);
$cat3 = current($path)+0;
// 1. NAVI (Menu horizontal)
$NAV1 = "";
$cat_id = 0;
@include $REX[INCLUDE_PATH]."/generated/categories/$cat_id.list.category";
$NAV = $REX[RECAT][$cat_id];
for ($i=0;$i<count($NAV);$i++)
{
$id = current($NAV);
$aid = $REX[CAT][$id][article_id];
$name = $REX[CAT][$id][name];
if ($i==0) $NAV1 .= "";
// wofür brauche ich das?!?!
@include $REX[INCLUDE_PATH]."/generated/articles/$aid.article";
if ($cat2==$id and $REX[CAT][$id][status]==1)
// Selected navbaritem
{
$NAV1 .= "<li><a href=index.php?article_id=$aid class=nava>$name</a></li>";
if ($NAV2 != "") $NAV1 .= "$NAV2"; //alte Version "<li> </li>$NAV2"
}elseif ($REX[CAT][$id][status]==1)
{
if ($name == "")
// No navbaritem (placeholder)
{
$NAV1 .= "<li> </li>";
}else
// Not selected navbaritem
{
$NAV1 .= "<li><a href=index.php?article_id=$aid class=nav>$name</a></li>";
}
}
if (($i+1)==count($NAV)) $NAV1 .= "";
next($NAV);
}
echo $NAV1;
?>
</ul>
Jetzt brauche ich dringend Nach-Hilfe!!! Was ich auch nicht verstehe ist, warum wird die Navigation nicht durch ein select* ... direkt aus der Datenbank generiert - aber das nur am Rande...
Liebe Grüße
Reinhold