Seite 1 von 1

Das Title-Tag-Modul

Verfasst: Do 18. Okt 2012, 19:02
von uwe-schmitt
Hallo an alle,

ich möchte beim aktuellen Title-Tag-Modul die Ausgabe verändern.

Code: Alles auswählen

<?php
/**
* $RCSfile$
*
* Description: Print HTML title tag content
*
* @version 1.0.0
* @author Rudi Bieller
* @copyright four for business AG <www.4fb.de>
*
* {@internal
* created 2008-04-07
* }}
*
* $Id$
*/

cInclude('classes', 'Contenido_FrontendNavigation/Contenido_FrontendNavigation_Breadcrumb.class.php');
try {
    $oBread = new Contenido_FrontendNavigation_Breadcrumb($db, $cfg, $client, $lang, $cfgClient);
    $oBreadCats = $oBread->get($idcat, 1);
    $sBread = 'Betreuung und Pflege DAHEIM';
    $aBread = array();
    $sBread .= implode(' - ', $aBread);
    $oArticle = new Article($idart, $client, $lang);
    $sHeadline = strip_tags($oArticle->getContent('CMS_HTMLHEAD', 1));
    if ($sHeadline != '') {
        $sBread .= ' - '.$sHeadline;
    }
    echo $sBread;
} catch (InvalidArgumentException $eI) {
    echo 'Contenido';
} catch (Exception $e) {
    echo 'Contenido';
}
?>
Und zwar möchte ich, dass die Ausgabe der Überschrift ($sHeadline) vor der Pfadausgabe ($sBread) steht.
Leider sind meine PHP-Kenntnisse sehr dürftig… Vielleicht kann mir jemand auf die Sprünge helfen? Vielen Dank schonmal im Voraus.

Gruß
Uwe

Re: Das Title-Tag-Modul

Verfasst: Do 18. Okt 2012, 23:57
von xmurrix
Hallo Uwe,

ändere die Zeilen

Code: Alles auswählen

    if ($sHeadline != '') {
        $sBread .= ' - '.$sHeadline;
    }
in

Code: Alles auswählen

    if ($sHeadline != '') {
        $sBread = $sHeadline . ' - ' . $sBread;
    }

Re: Das Title-Tag-Modul

Verfasst: Fr 19. Okt 2012, 00:11
von uwe-schmitt
Hallo Murat,

super! Vielen Dank für Deine Hilfe.

Gruß
Uwe

Re: Das Title-Tag-Modul

Verfasst: Do 25. Okt 2012, 14:13
von canucks
Hallo zusammen,

Ich hätte auch noch eine Frage zu diesem Modul.
und zwar möchte ich es als Überschrift im "Text" verwenden.
Dort soll aber nur die Kategorie (Oberste Stufe, nicht die Sub_Navigation) angezeigt werden. Also ohne den Websitenamen und Artikel. was muss ich da herauslöschen. Den Websitennamen konnte ich entfernen, aber mit dem Artikel klappt es (noch) nicht.

Code: Alles auswählen

<?php
/**
* $RCSfile$
*
* Description: Print HTML title tag content
*
* @version 1.0.0
* @author Rudi Bieller
* @copyright four for business AG <www.4fb.de>
*
* {@internal
* created 2008-04-07
* }}
*
* $Id$
*/

cInclude('classes', 'Contenido_FrontendNavigation/Contenido_FrontendNavigation_Breadcrumb.class.php');
try {
    $oBread = new Contenido_FrontendNavigation_Breadcrumb($db, $cfg, $client, $lang, $cfgClient);
    $oBreadCats = $oBread->get($idcat, 1);

    $aBread = array();
    foreach ($oBreadCats as $oConCat) {
        $aBread[] = $oConCat->getCategoryLanguage()->getName();
    }
    $sBread .= implode(' - ', $aBread);
    $oArticle = new Article($idart, $client, $lang);
    $sHeadline = strip_tags($oArticle->getContent('CMS_HTMLHEAD', 1));
    if ($sHeadline != '') {
        $sBread = $sHeadline . ' - ' . $sBread;
    }
    echo $sBread;
} catch (InvalidArgumentException $eI) {
    echo 'Contenido';
} catch (Exception $e) {
    echo 'Contenido';
}
?>
Kann mir da jemand weiterhelfen?

Gruss Thomas

Re: Das Title-Tag-Modul

Verfasst: Do 25. Okt 2012, 15:21
von Spider IT
Hallo Thomas,

die foreach-Schleife geht durch die Ebenen der Navigation durch, beende also die Schleife nach dem erste Durchgang per break;

Code: Alles auswählen

    foreach ($oBreadCats as $oConCat) {
        $aBread[] = $oConCat->getCategoryLanguage()->getName();
        break;
    }
Gruß
René

Re: Das Title-Tag-Modul

Verfasst: Do 25. Okt 2012, 19:43
von canucks
Hallo René,

Hat geklappt super!
Besten Dank für die rasche Unterstützung!

Gruss Thomas