mit dem Standardmodul meta_navigation habe ich Probleme bei der Darstellung von URL mit Hilfe von mod_rewrite.
Anfang sahen meine Links in der Meta Navigation wie folgt aus:
www.beispiel.de/index.html&a=2&level=1
Nach der hier erläuterten Änderung http://forum.contenido.org/viewtopic.ph ... Blevel%3D1 sehen die Links wie nachstehend aus:
www.beispiel.de/index.html
Wieso werden die Kategorienamen nicht so wie in der Main Navigation mit angezeigt?
Zum Beispiel:
www.beispiel.de/impressum/index.html
www.beispiel.de/datenschutz/index.html
Dadurch stimmt die Verlinkung jedes Mal nicht und mit einem Klick gelangt man auf die Startseite.
Aufbau meiner Navigation:
Root
- Hauptnavigation
-- ...
-- ...
- Metanavigation
-- Impressum
-- Datenschutz
-- Kontakt
Modul Meta_Navigation:
Code: Alles auswählen
<?php
/**
* $RCSfile$
*
* Description: Meta Navigation on bottom of page
*
* @version 1.0.0
* @author Rxxx Bxxxxx
* @copyright fxxx fxx bxxxxxxxxxxx
*
* {@internal
* created 2008-04-07
* }}
*
* $Id$
*/
// include Contenido_FrontendNavigation class
cInclude('classes', 'Contenido_FrontendNavigation/Contenido_FrontendNavigation.class.php');
// get start idcat
$iIdcatStart = getEffectiveSetting('navigation', 'idcat-meta', 2);
//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) {
// this is just for sample client - modify to your needs!
if ($cfg['url_builder']['name'] == 'front_content' || $cfg['url_builder']['name'] == 'MR') {
$aParams = array('lang' => $lang, 'idcat' => $oContenidoCategory->getIdCat());
} else {
$aParams = array('a' => $oContenidoCategory->getIdCat(),
'idcat' => $oContenidoCategory->getIdCat(), // needed to build category path
'lang' => $lang, // needed to build category path
'level' => 0); // needed to build category path
}
try {
$tpl->set('d', 'url', Contenido_Url::getInstance()->build($aParams));
} catch (InvalidArgumentException $e) {
$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->next();
}
$sItems = $tpl->generate('templates/navigation_meta_item.html', true, false);
$tpl->reset();
$tpl->set('s', 'items', $sItems);
$tpl->generate('templates/navigation_meta_container.html');
}
} catch (Exception $e) {
echo 'Shit happens: ' . $e->getMessage() . ': ' . $e->getFile() . ' at line '.$e->getLine() . ' ('.$e->getTraceAsString().')';
}
?>
Errorlog: keine Einträge
Über eine Antwort würde ich mich sehr freuen!