Seite 1 von 1

Ausgabe der Sitemap des Demo Mandanten

Verfasst: Mi 23. Sep 2009, 17:03
von langwebdesign
Hallo,

ich möchte gern die Ausgabe der Sitemap des Demomandanten anpassen, aber komm gerade nicht ganz zurecht.
Standardmäßig wird alles in ein ul ausgegeben.
Ich hatte aber gerne für jede Unterkategorie eine eigene ul
So z.B.

Code: Alles auswählen

<ul>
<li><a href="#l">kat  1</a></li>
<li><a href="#">kat 2</a>
  <ul>
    <li><a href="#">kat 2.1</a></li>
    <li><a href="#">kat 2.1</a>
      <ul>
        <li><a href="#">kat 2.1.1</a></li>
      </ul>
   </li>
  </ul>
<li><a href="#l">kat  3</a></li>
</ul>
ich bin mir aber nicht sicher ob das mit dem PHP code so wies jetzt ist funktioniert, und das ist mir fast ein bischen zu hoch...

Sitemap Modul output:

Code: Alles auswählen

<?php
/**
 * Project: 
 * contenido.org
 * 
 * Description: 
 * Simple sitemap.
 * Can output all categories in one list or each main category as separate list
 * 
 * To modify the behaviour of the module (e.g. style of URL, CSS classes, ...), you need to edit Contenido_Sitemap_Util::loopCats
 * @see {frontend}/includes/Util/Modules/Contenido_Sitemap_Util.class.php
 * 
 * Requirements: 
 * @con_php_req 5.0
 * 
 *
 * @version    0.1.0
 * @author     Rudi Bieller
 * @copyright  four for business AG <www.4fb.de>
 * 
 * {@internal 
 *   created 2009-01-05
 *   $Id: Sitemap_Standard.php 3438 2009-01-15 10:54:05Z rudi.bieller $
 * }}
 * 
 */

if (!isset($db)) {
    $db = new DB_Contenido();
}
if (!isset($tpl)) {
    $tpl = new Template();
}
$tpl->reset();

cInclude('classes', 'Contenido_FrontendNavigation/Contenido_FrontendNavigation.class.php');
cInclude('frontend', 'includes/Util/Modules/Contenido_Sitemap_Util.class.php');

$iSelectedCat = intval("CMS_VALUE[1]");
$iSelectedDepth = intval("CMS_VALUE[2]");
$iHtmlOutputType = intval("CMS_VALUE[3]");
$sUrlStyle = $cfg['url_builder']['name'];

if ($iSelectedCat > 0 && $iSelectedDepth >= 0) {
    $oFeNav = new Contenido_FrontendNavigation($db, $cfg, $client, $lang, $cfgClient);
    $oFeNav->setAuth($auth);
    $oSubCategories = $oFeNav->getSubCategories($iSelectedCat, true, true, 1);
    // see if there are any subcategories to display
    if ($oSubCategories->count() > 0) {
        $aDepthInfo = array();
        $aDepthInfo[0] = 0;
        $aDepthInfo[1] = $iSelectedDepth;
        if ($iHtmlOutputType == 1) {
            $sMainCats = '';
        }
        foreach ($oSubCategories as $oSubCategory) {
            switch($iHtmlOutputType) {
                case 0:
                    Contenido_Sitemap_Util::loopCats($oSubCategory, $oFeNav, $tpl, $sUrlStyle, $cfg, $lang, $aDepthInfo);
                    break;
                case 1:
                    $tpl->reset();
                    Contenido_Sitemap_Util::loopCats($oSubCategory, $oFeNav, $tpl, $sUrlStyle, $cfg, $lang, $aDepthInfo);
                    $sSubCats = $tpl->generate('templates/sitemap_standard_li.html', true);
                    $tpl->reset();
                    $tpl->set('s', 'list_items', $sSubCats);
                    $sMainCats .= $tpl->generate('templates/sitemap_standard_ul.html', true);
                    break;
                default:
                    break;
            }
        }
        if ($iHtmlOutputType == 0) {
            $tpl->generate('templates/sitemap_standard.html');
        } else {
            echo $sMainCats;
        }
    }
} else {
    echo '<p>Sitemap not configured correctly.</p>';
}
?>
ich gehe mal davon aus das ich irgendwas in die foreach einbauen muss um die einzelnen Unterkategorien auseinander zu kennen?
Könnt ihr mir ein paar Tipps geben?

mfg stephan

Contenido 4.8.12
AMR kommt später auch noch drauf...

Re: Ausgabe der Sitemap des Demo Mandanten

Verfasst: Do 24. Sep 2009, 11:09
von thoste87
gar nichts ändern musst du - reicht wenn du das im artikel unter konfiguration auswählst...

Re: Ausgabe der Sitemap des Demo Mandanten

Verfasst: Do 24. Sep 2009, 13:28
von langwebdesign
Hi,

das hat aber nicht funktioniert.
Konnte da keine Änderungen feststellen.
Ich hab mir jetzt eine etwas ältere Sitemap so angepasst damit es funktioniert.
Ich muss mir mal bei Gelegenheit das Modul und die Klasse dazu genauer anschauen.

mfg stephan