Benötige Eure Hilfe bei einem herkömmlichen Navigations-Modul, welches an wenigen Stellen etwas erweitert wurde.
Das Modul sollte bekannt sein, geschrieben von Rudi Bieller - eine Navigation wird via Template ausgegeben.
Meine Anpassungen betreffen den Teil mit $actualidcat sowie dem Einbau mit der Subnavigation.
Das Problem selber befindet sich an folgender Stelle:
Code: Alles auswählen
// fill submenue
$sSubmenue = $subtpl->generate('templates/subnavigation_standard.html', true, false);
//echo "submenue: ".$sSubmenue;
$tpl->set('d', 'submenue', $sSubmenue);
Ich hoffe, jemand kann mir sagen, wo mein Fehler liegt. Vielen Dank schon zum Voraus! Der ganze Rest funktioniert nämlich wunderbar...
Grüsse,
Nepstar
Anbei noch der gesamte Output des Moduls:
Code: Alles auswählen
<?php
/**
* $RCSfile$
*
* Description: Meta Navigation on bottom of page
*
* @version 1.0.0
* @author Rudi Bieller
* @copyright four for business AG <www.4fb.de>
*
* {@internal
* created 2008-04-07
* }}
*
* $Id$
*/
// include Contenido_FrontendNavigation class
cInclude('classes', 'Contenido_FrontendNavigation/Contenido_FrontendNavigation.class.php');
cInclude('frontend', 'includes/functions.navigation.php');
// get start idcat
$iIdcatStart = 1;
//check if there is a template instance
if (!isset($tpl) || !is_object($tpl)) {
$tpl = new Template();
}
// reset template object
$tpl->reset();
// build navigation
try {
$oFeNav = new Contenido_FrontendNavigation($db, $cfg, $client, $lang, $cfgClient);
$oContenidoCategories = $oFeNav->getSubCategories($iIdcatStart, true);
if ($oContenidoCategories->count() > 0) {
foreach ($oContenidoCategories as $oContenidoCategory) {
$actualidcat = $oContenidoCategory->getIdCat();
$tpl->set('d', 'url', 'front_content.php?idcat='.$oContenidoCategory->getIdCat());
$tpl->set('d', 'title', $oContenidoCategory->getCategoryLanguage()->getName());
$tpl->set('d', 'label', $oContenidoCategory->getCategoryLanguage()->getName());
$tpl->set('d', 'name', $oContenidoCategory->getCategoryLanguage()->getName());
//if it is active
$tempArray = getCategoryPath($idcat, 0, false, $db);
if ($idcat == $actualidcat || in_array($actualidcat, $tempArray) ) $tpl->set('d', 'params', ' class="active"');
else $tpl->set('d', 'params', '');
$tpl->set('d', 'submenue', '');
// subnav
$oFeSubNav = new Contenido_FrontendNavigation($db, $cfg, $client, $lang, $cfgClient);
$oSubCategories = $oFeSubNav->getSubCategories($oContenidoCategory->getIdCat(), true);
if($oSubCategories->count() > 0) {
$subtpl = new Template();
$subtpl->reset();
foreach($oSubCategories as $oSubCat) {
$subtpl->set('d', 'url', 'front_content.php?idcat='.$oSubCat->getIdCat());
$subtpl->set('d', 'title', $oSubCat->getCategoryLanguage()->getName());
$subtpl->set('d', 'label', $oSubCat->getCategoryLanguage()->getName());
$subtpl->set('d', 'name', $oSubCat->getCategoryLanguage()->getName());
$subtpl->set('d', 'params', ' class="menu-item menu-item-type-post_type menu-item-object-page "');
$subtpl->next();
}
$sSubItems = $subtpl->generate('templates/subnavigation_standard_item.html', true, false);
$subtpl->reset();
$subtpl->set('s', 'items', $sSubItems);
// fill submenue
$sSubmenue = $subtpl->generate('templates/subnavigation_standard.html', true, false);
//echo "submenue: ".$sSubmenue;
$tpl->set('d', 'submenue', $sSubmenue);
}
$tpl->next();
}
$sItems = $tpl->generate('templates/navigation_standard_item.html', true, false);
//echo "items: ".$sItems;
$tpl->reset();
$tpl->set('s', 'items', $sItems);
echo $tpl->generate('templates/navigation_standard.html');
}
} catch (Exception $e) {
echo 'Shit happens: ' . $e->getMessage() . ': ' . $e->getFile() . ' at line '.$e->getLine() . ' ('.$e->getTraceAsString().')';
}
?>