Gelöst: Navigation aus Beispielmandant funktioniert nicht
Verfasst: Mo 1. Dez 2008, 23:39
Hallo,
schon wieder mal kurz vorm verzweifeln.
Ich habe eine neuen Mandanten angelegt. Bequem wie ich war die Module aus dem Beispielmandanten exportiert und beim neuen Mandanten importiert. So weit so gut.
Mit entsprechender Anpassung funktionieren die erforderlichen Module bis jetzt auch, bis auf die Navigation.
Ich hab im Layout folgendes stehen:
Die erste Kategorie fängt komischerweise auch bei idcat=37 an, sei's drum.
Die Seite wird auch brav angezeigt, eben nur ohne Navigation. Der andere Content ist vorhanden und ok.
Im Quelltext ist von der Navigation auch nix zu sehen, einfach leer, so als wenn er das Modul nicht findet.
Das Modul Navigation_Main sieht bei mir so aus:
Html-Template ist auch vorhanden im Template-Verzeichnis des neuen Mandante, eben weil auch kopiert.
Vorsichtshalber habe ich dem Container auch die id=37 gegeben.
Unter Administrator - Templates ist das m.E. auch richtig vorhanden:

Irgendwo muss ich einen Fehler haben, ich tippe in erster Linie auf ein Verständnisfehler im Hirn, aber ich finde den ums verrecken nicht.
CSS-Datei ist auch ok und vorhanden(Kopie vom Beispielmandanten)
Ich kann mir nur denken, dass ich evtl. in der Namesvergabe des Navigationsbaumes etwas falsch gemacht habe, der heißt bei mir "Home".
Hab aber im Forum auch nix Passendes gefunden.
Wer hat einen Tipp für mich?
Danke im Voraus
Björn
schon wieder mal kurz vorm verzweifeln.
Ich habe eine neuen Mandanten angelegt. Bequem wie ich war die Module aus dem Beispielmandanten exportiert und beim neuen Mandanten importiert. So weit so gut.
Mit entsprechender Anpassung funktionieren die erforderlichen Module bis jetzt auch, bis auf die Navigation.
Ich hab im Layout folgendes stehen:
Code: Alles auswählen
<div id="navigation">
<container id="37" name="Navigation_Main" types="Navigation" mode="fixed" default="Navigation_Main">Navigation_Main</container>
</div>
Die Seite wird auch brav angezeigt, eben nur ohne Navigation. Der andere Content ist vorhanden und ok.
Im Quelltext ist von der Navigation auch nix zu sehen, einfach leer, so als wenn er das Modul nicht findet.
Das Modul Navigation_Main sieht bei mir so aus:
Code: Alles auswählen
<?php
/**
* $RCSfile$
*
* Description: Navigation, left side.
*
* @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('classes', 'Contenido_FrontendNavigation/Contenido_FrontendNavigation_Breadcrumb.class.php');
// get start idcat
$iIdcatStart = getEffectiveSetting('navigation', 'idcat-home', 37);
// instantiate 2nd + 3rd template object, reset all
$tpl2 = new Template();
$tpl3 = new Template();
if (!isset($tpl) || !is_object($tpl)) {
$tpl = new Template();
}
$tpl->reset();
$tpl2->reset();
$tpl3->reset();
// build navigation
try {
$oFeNav = new Contenido_FrontendNavigation($db, $cfg, $client, $lang, $cfgClient);
$oBreadcrumb = new Contenido_FrontendNavigation_Breadcrumb($db, $cfg, $client, $lang, $cfgClient);
$aBreadcrumb = $oBreadcrumb->getAsArray($idcat, 1); // this nav starts at level 1
$oFeNav->setAuth($auth); // to make sure user sees what he's allowed to see
$oContenidoCategories = $oFeNav->getSubCategories($iIdcatStart, true);
if ($oContenidoCategories->count() > 0) {
foreach ($oContenidoCategories as $oContenidoCategory) {
$sSubcats = '';
$tpl2->reset();
$bHasActiveSubCat = false;
// check if we need to load subcategories
$oSubCatsLevel2 = $oFeNav->getSubCategories($oContenidoCategory->getIdCat(), true);
$aSubCatsLevel2 = $oFeNav->getSubCategories($oContenidoCategory->getIdCat(), false);
$bShowSubcatLevel2 = (intval($idcat) == $oContenidoCategory->getIdCat() || in_array(intval($idcat), $aSubCatsLevel2)
|| (isset($aBreadcrumb[2]) && intval($idcat) == $aBreadcrumb[2] && in_array($aBreadcrumb[1], $aSubCatsLevel2)))
? true : false;
if ($bShowSubcatLevel2 === true && $oSubCatsLevel2->count() > 0) {
foreach ($oFeNav->getSubCategories($oContenidoCategory->getIdCat(), true) as $oSubCategory) {
$bHasActiveSubSubCat = false;
// check if we need to load subsubcategories
$oSubCatsLevel3 = $oFeNav->getSubCategories($oSubCategory->getIdCat(), true);
$aSubCatsLevel3 = $oFeNav->getSubCategories($oSubCategory->getIdCat(), false);
$bShowSubcatLevel3 = (intval($idcat) == $oSubCategory->getIdCat() ||
in_array(intval($idcat), $aSubCatsLevel3))
? true : false;
$sSubcats2 = '';
if ($bShowSubcatLevel3 === true && $oSubCatsLevel3->count() > 0) {
foreach ($oSubCatsLevel3 as $oSubSubCategories) {
if ($bHasActiveSubCat === false && intval($idcat) == $oSubSubCategories->getIdCat()) {
$bHasActiveSubCat = true;
}
if ($bHasActiveSubSubCat === false && intval($idcat) == $oSubSubCategories->getIdCat()) {
$bHasActiveSubSubCat = true;
}
toTpl($tpl3, $oSubSubCategories, (intval($idcat) == $oSubSubCategories->getIdCat() ? ' class="active"' : ''), '');
}
$sSubcats2 = $tpl3->generate('templates/navigation_main_item.html', true, false);
$tpl3->reset();
$tpl3->set('s', 'items', $sSubcats2);
$tpl3->set('s', 'css-class', ' class="subSubNavigation"');
$sSubcats2 = $tpl3->generate('templates/navigation_main_container.html', true, false);
}
if ($bHasActiveSubCat === false && intval($idcat) == $oSubCategory->getIdCat()) {
$bHasActiveSubCat = true;
}
toTpl($tpl2, $oSubCategory,
(intval($idcat) == $oSubCategory->getIdCat() || $bHasActiveSubSubCat === true ? ' class="active"' : ''),
$sSubcats2);
}
$sSubcats = $tpl2->generate('templates/navigation_main_item.html', true, false);
$tpl2->reset();
$tpl2->set('s', 'items', $sSubcats);
$tpl2->set('s', 'css-class', ' class="subNavigation"');
$sSubcats = $tpl2->generate('templates/navigation_main_container.html', true, false);
}
toTpl($tpl, $oContenidoCategory, ($bHasActiveSubCat === true || intval($idcat) == $oContenidoCategory->getIdCat() ? ' class="active"' : ''), $sSubcats);
}
$sCats = $tpl->generate('templates/navigation_main_item.html', true, false);
$tpl->reset();
$tpl->set('s', 'css-class', '');
$tpl->set('s', 'items', $sCats);
$tpl->generate('templates/navigation_main_container.html');
}
} catch (Exception $e) {
echo 'Some error occured: ' . $e->getMessage() . ': ' . $e->getFile() . ' at line '.$e->getLine() . ' ('.$e->getTraceAsString().')';
}
/**
* Helper to push values to Template object
* @param Template $oTpl
* @param Contenido_Category $oCat
* @param string $sActiveCssClass must bei either empty string or " class="classname"
* @param string $sSubcats String with subcategories of current category
*/
function toTpl(&$oTpl, Contenido_Category $oCat, $sActiveCssClass, $sSubcats) {
$oTpl->set('d', 'css-class', $sActiveCssClass);
$oTpl->set('d', 'url', 'front_content.php?idcat='.$oCat->getIdCat());
$oTpl->set('d', 'title', $oCat->getCategoryLanguage()->getName());
$oTpl->set('d', 'label', $oCat->getCategoryLanguage()->getName());
$oTpl->set('d', 'subcategories', $sSubcats); // followup level
$oTpl->next();
}
?>
Vorsichtshalber habe ich dem Container auch die id=37 gegeben.
Unter Administrator - Templates ist das m.E. auch richtig vorhanden:

Irgendwo muss ich einen Fehler haben, ich tippe in erster Linie auf ein Verständnisfehler im Hirn, aber ich finde den ums verrecken nicht.
CSS-Datei ist auch ok und vorhanden(Kopie vom Beispielmandanten)
Ich kann mir nur denken, dass ich evtl. in der Namesvergabe des Navigationsbaumes etwas falsch gemacht habe, der heißt bei mir "Home".
Hab aber im Forum auch nix Passendes gefunden.
Wer hat einen Tipp für mich?
Danke im Voraus
Björn