[gelöst] Artikel Eigenschaften Weiterleitung _blank

Gesperrt
yodatortenboxer
Beiträge: 424
Registriert: Do 22. Jan 2004, 14:45
Wohnort: Kölpinsee auf Usedom
Kontaktdaten:

[gelöst] Artikel Eigenschaften Weiterleitung _blank

Beitrag von yodatortenboxer »

Hiho,

wo bzw. wie muss hier bei der Standart Navi der 4.8.x das target="xxxx" eingefügt werden?

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', 1);

// 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();
}
?>
Ich denke einmal irgendwo in der Funktion

Code: Alles auswählen

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();
}
aber ich weis nicht genau und auch nicht mit welchen Variablen.

Im Modultemplate das

Code: Alles auswählen

<!-- BEGIN:BLOCK -->
                    <li{css-class}><a href="{url}" target="{target}"  title="{title} ">{label}</a>{subcategories}</li>
<!-- END:BLOCK -->
hab ich schon und in den Mandanteneinstellungen das

Code: Alles auswählen

articles	show-new-window-checkbox	true
auch schon und die Checkbox (Neues Fenster) ist in den Artikeleigenschaften bei Weiterleitung ebenfalls vorhanden.

Mir geht es nur um das Modul oben. Die anderen Beiträge mit den anderen "alten Modulen" sind uninteressant und bringen mich hier nicht weiter.

Gruß yodatortenboxer
Zuletzt geändert von yodatortenboxer am Mi 3. Sep 2008, 06:57, insgesamt 1-mal geändert.
rbi
Beiträge: 95
Registriert: Do 27. Sep 2007, 21:33
Kontaktdaten:

Beitrag von rbi »

Was hast du denn vor? Welche Navipunkte sollen in einem neuen Fenster aufgehen? Die Mandanteneinstellung sagt mir nichts..

Edit: Ah, ich glaube, ich verstehe.. Das Modul verlinkt direkt auf idcat (wodurch der Startartikel genutzt wird). Du müsstest es also so erweitern, dass du den Startartikel der jeweiligen Kategorie holst und dort die Eigenschaft ausliest.
yodatortenboxer
Beiträge: 424
Registriert: Do 22. Jan 2004, 14:45
Wohnort: Kölpinsee auf Usedom
Kontaktdaten:

Beitrag von yodatortenboxer »

Das Modul oben ist ja das Standart Navigation Main Modul was bei der Contenido V4.8.x mitinstalliert wird.

Ich mache dann ganz normal eine Kategorie Hauptnavi mit den Navipunkten Beispiel:

Punkt a
Punkt b
Punkt c
Punkt d
Punkt e

Jeder dieser Punkte ruft dann dementsprechend die front_content.php?idcat=xx auf. Bei Punkt d möchte ich nun aber eine andere URL in einem externes Fenster öffnen. Also stelle ich bei dem Startartikel in den Eigenschaften die Weiterleitung auf die andere URL ein und mache dann einen Haken bei Neues Fenster.
dass du den Startartikel der jeweiligen Kategorie holst und dort die Eigenschaft ausliest.
yep, das also die Eigenschaft des Artikels bei dem Target (DB con_art_lang in der Spalte external_redirect) ausgelesen werden müsste und dann dementsprechend im Modul beim Templategenerieren hinterlegt wird. Ich kenne nur die richtigen Variablen nicht.

Mich interessiert nun eigentlich nur ob es dafür schon eine fertige/vorhandene Variable gibt die man nur noch einsetzen muss. Ich wollte eigentlich nun nicht Stundenlang alle Klassen durchsuchen. Das Teil bzw. die dazugehörigen Klassen wurden ja von jemand programmiert und der müsste da ja bescheit wissen.

gruß yodatortenboxer
rbi
Beiträge: 95
Registriert: Do 27. Sep 2007, 21:33
Kontaktdaten:

Beitrag von rbi »

Für das Modul gibt es nichts fertiges, mit dem man das machen kann.
Es gibt aber irgendwo in Contenido eine Funktion, mit der man den Startartikel einer Kategorie bekommt - die kann ich dir spontan aber nicht sagen, weil ich gerade kein Contenido vor mir habe, in dem ich suchen kann... Aber vielleicht findest du es ja. ;)
Dann musst du für die idcats, die in $aBreadcrumb/$aSubCatsLevel2/.. sind, die zugehörigen Startartikel holen und aus deren Eigenschaften das target auslesen.
andy-man
Beiträge: 166
Registriert: Di 25. Nov 2003, 11:29
Wohnort: Oberstaufenbach
Kontaktdaten:

Beitrag von andy-man »

Hallo, leider wird in diesem Modul nicht das "external_redirect" geprüft.
http://forum.contenido.org/viewtopic.ph ... c&start=15

dies wird umgesetzt, wenn du im Modul Navigation_Main noch folgenden Code einfügst, dann funktioniert es

Code: Alles auswählen

cInclude("frontend", "includes/functions.navigation.php");
und im Template müsste noch

Code: Alles auswählen

target="{TARGET}"
ergänzt werden.

Gruss andy-man
yodatortenboxer
Beiträge: 424
Registriert: Do 22. Jan 2004, 14:45
Wohnort: Kölpinsee auf Usedom
Kontaktdaten:

Beitrag von yodatortenboxer »

Hiho andy-man,
Hallo, leider wird in diesem Modul nicht das "external_redirect" geprüft.
http://forum.contenido.org/viewtopic.ph ... c&start=15
Der Link bezieht soweit ich die Artikel alle gelesen habe nur auf die 4.6.x und da ist das Standartnavi Modul komplett anders als wie bei der 4.8.x aufgebaut.
dies wird umgesetzt, wenn du im Modul Navigation_Main noch folgenden Code einfügst, dann funktioniert es
Code:
cInclude("frontend", "includes/functions.navigation.php");
dadurch habe ich zwar dann diese Funktionen im Modul, aber mit welchen Variablen soll ich dann dort im Modul von oben weiterarbeiten?
Standartmäßig arbeitet das Modul der V4.8.x oben mit folgenden Klassen

Code: Alles auswählen

// include Contenido_FrontendNavigation class
cInclude('classes', 'Contenido_FrontendNavigation/Contenido_FrontendNavigation.class.php');
cInclude('classes', 'Contenido_FrontendNavigation/Contenido_FrontendNavigation_Breadcrumb.class.php'); 
die in der 4.6.x soweit ich weis gar nicht vorhanden sind.

Das Modul unter dem Link http://forum.contenido.org/viewtopic.ph ... c&start=15 verwendet zum Beispiel die $data als Array worin dann idcat, Name und Target gespeichert sind.

Code: Alles auswählen

$tpl->reset();
$tpl->set('d', 'NAME', $data['name']);
$tpl->set('d', 'TARGET', $data['target']);
$tpl->set('d', 'HREF',  $sess->url('front_content.php?idcatart='.navidcatart($data['idcat'])));
$tpl->next(); 
In der 4.8.x sieht aber diese Stelle so aus:

Code: Alles auswählen

$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();
Da geht alles über die im Modul oben eingebungenen Klassen.
Es wird hier also der Name zum Beispiel über

Code: Alles auswählen

$oTpl->set('d', 'title', $oCat->getCategoryLanguage()->getName()); 
ausgegeben, die idcat über

Code: Alles auswählen

$oTpl->set('d', 'url', 'front_content.php?idcat='.$oCat->getIdCat());
Und da suche ich die richtige Variable für das Target.

Code: Alles auswählen

und im Template müsste noch

Code:
target="{TARGET}"
ergänzt werden. 
Das ist im Template schon drin. Dann wird aber ohne eine dementsprechende Änderung im Modul im Quelltext nur target="{TARGET}" ausgegeben und das {TARGET} nicht dementsprechend durch _self oder _blank ersetzt. Dieses Ersetzen müsste ja noch im Modul hinterlegt werden. Und da suche ich das wie.

Gruß yodatortenboxer
yodatortenboxer
Beiträge: 424
Registriert: Do 22. Jan 2004, 14:45
Wohnort: Kölpinsee auf Usedom
Kontaktdaten:

Beitrag von yodatortenboxer »

Sodelle...

hab nun mal wieder Zeit für das Problem gefunden.
Ich hab es nun folgendermaßen gelöst und die vorhandene Funktion im Modul:

Code: Alles auswählen

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();
}
?>
mit folgender ersetzt:

Code: Alles auswählen

function toTpl(&$oTpl, Contenido_Category $oCat, $sActiveCssClass, $sSubcats) {

    global $db;
    global $cfg;

    $oTpl->set('d', 'css-class', $sActiveCssClass);
    $oTpl->set('d', 'url', 'front_content.php?idcat='.$oCat->getIdCat());
    $sql_redir="SELECT
                    redirect,
                    external_redirect 
                FROM
                    `".$cfg["tab"]["cat_art"]."`,
                    `".$cfg["tab"]["art_lang"]."`
                WHERE
                    idcat=".$oCat->getIdCat()." AND
                    `".$cfg["tab"]["cat_art"]."`.idart=`".$cfg["tab"]["art_lang"]."`.idart";
    $db->query($sql_redir);
    $db->next_record();
    if(($db->f("redirect")==1)AND($db->f("external_redirect")==1)){$getTarget="_blank";}else{$getTarget="_self";}
    $oTpl->set('d', 'target', $getTarget);
    $oTpl->set('d', 'title', $oCat->getCategoryLanguage()->getName());
    $oTpl->set('d', 'label', $oCat->getCategoryLanguage()->getName());
    $oTpl->set('d', 'subcategories', $sSubcats); // followup level
    $oTpl->next();
}
Dann hab ich im Template navigation_main_item.html das target folgendermaßen eingefügt:

Code: Alles auswählen

<!-- BEGIN:BLOCK -->
                    <li{css-class}><a target="{target}" href="{url}" title="{title} ">{label}</a>{subcategories}</li>
<!-- END:BLOCK -->
und das wars. In den Mandanteneinstellugnen darf natürlich das

Code: Alles auswählen

articles   show-new-window-checkbox   true
nicht fehlen.

Setze ich nun bei den Artikeleigenschaften unter Weiterleitung bei der Checkbox "Neues Fenster" einen Haken, bekommt der Artikel beim Aufruf über den Kategorielink ein target"_blank" während standartmäßig ein target"_self" vergeben wird.

Die Ausgabe ist dann als Beispiel also so wenn bei test2 und test4 der Haken gesetzt ist:

Code: Alles auswählen

<ul>
<li><a target="_self" href="front_content.php?idcat=23" title="test">test</a></li>
<li><a target="_blank" href="front_content.php?idcat=24" title="test2">test2</a></li>
<li><a target="_self" href="front_content.php?idcat=25" title="test3">test3</a></li>
<li><a target="_blank" href="front_content.php?idcat=26" title="test4">test4</a></li>
<li><a target="_self" href="front_content.php?idcat=27" title="test5">test5</a></li>
</ul>
Das ganze Modul ist noch einmal hier:

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', 1);

// 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) {

    global $db;
    global $cfg;

    $oTpl->set('d', 'css-class', $sActiveCssClass);
    $oTpl->set('d', 'url', 'front_content.php?idcat='.$oCat->getIdCat());
    $sql_redir="SELECT
                    redirect,
                    external_redirect 
                FROM
                    `".$cfg["tab"]["cat_art"]."`,
                    `".$cfg["tab"]["art_lang"]."`
                WHERE
                    idcat=".$oCat->getIdCat()." AND
                    `".$cfg["tab"]["cat_art"]."`.idart=`".$cfg["tab"]["art_lang"]."`.idart";
    $db->query($sql_redir);
    $db->next_record();
    if(($db->f("redirect")==1)AND($db->f("external_redirect")==1)){$getTarget="_blank";}else{$getTarget="_self";}
    $oTpl->set('d', 'target', $getTarget);
    $oTpl->set('d', 'title', $oCat->getCategoryLanguage()->getName());
    $oTpl->set('d', 'label', $oCat->getCategoryLanguage()->getName());
    $oTpl->set('d', 'subcategories', $sSubcats); // followup level
    $oTpl->next();
}
?>
Gruß yodatortenboxer
train
Beiträge: 32
Registriert: Do 20. Apr 2006, 10:05
Kontaktdaten:

Neues Browserfenster

Beitrag von train »

Hallo zusammen

Es klappt wunderbar, herzlichen Dank.
Herzlichen Dank für die Unterstützung

mfg

Train
dirkesch
Beiträge: 3
Registriert: So 18. Mai 2008, 21:57
Kontaktdaten:

Welches Modul ist zu korrigieren?

Beitrag von dirkesch »

Hallo,
ich bin Newbie und nicht sicher, welches Modul ich nun zu korrigieren habe, damit die _blank Weiterleitung funktioniert.
Über einen Tipp wäre ich dankbar. Der Code wurde ja freundlicherweise bereits gepostet.
Danke.
yodatortenboxer
Beiträge: 424
Registriert: Do 22. Jan 2004, 14:45
Wohnort: Kölpinsee auf Usedom
Kontaktdaten:

Beitrag von yodatortenboxer »

Hallo,

im Backend unter Style => Module das Modul Navigation_Main.

Code: Alles auswählen

* Description: Navigation, left side.
*
* @version 1.0.0
* @author Rudi Bieller
* @copyright four for business AG <www.4fb.de>
Gruß yodatortenboxer
dirkesch
Beiträge: 3
Registriert: So 18. Mai 2008, 21:57
Kontaktdaten:

Dieses Modul habe ich nicht

Beitrag von dirkesch »

Hallo und vielen Dank für die Antwort.
Ich habe Contenido 4.8 neu installiert. Dieses Modul habe ich nicht.
Soll ich es erzeugen?
yodatortenboxer
Beiträge: 424
Registriert: Do 22. Jan 2004, 14:45
Wohnort: Kölpinsee auf Usedom
Kontaktdaten:

Beitrag von yodatortenboxer »

Hallo,
Ich habe Contenido 4.8 neu installiert. Dieses Modul habe ich nicht.
Wenn du beim Contenido Setup auf Neuinstallation gehst, und dann im Step 5 "Mandant mit Beispielmodulen, aber ohne Beispielinhalte" oder "Mandant mit Beispielmodulen, aber ohne Beispielinhalte" wählst, werden alle mitgelieferten Module installiert. Dort ist es auf alle Fälle dabei.

Ansonsten einfach ein neues Modul anlegen und wie zwei Beiträge von mir weiter oben
Sodelle...

hab nun mal wieder Zeit für das Problem gefunden.
Ich hab es nun folgendermaßen gelöst und die vorhandene Funktion im Modul:
einbinden.

gruß yodatortenboxer
caps-log
Beiträge: 94
Registriert: Fr 5. Dez 2003, 09:56
Wohnort: Waiblingen
Kontaktdaten:

Re:

Beitrag von caps-log »

yodatortenboxer hat geschrieben: und das wars. In den Mandanteneinstellugnen darf natürlich das

Code: Alles auswählen

articles   show-new-window-checkbox   true
nicht fehlen.

Hi zusammen,
gibts auch ne Möglichkeit, eine Artikelweiterleitung auf target"_top" zu setzen? z.B. wenn ich innerhalb eines framesets
auf ein anders externes Frameset weiterleiten möchte?

Ich weiss, das ist alter Käse, aber kann vieleicht auch anderen nützlich sein....
ciao, Torsten
Hebt man den Blick,
so sieht man keine Grenzen.
(Aus Japan)

torsten w. licker
caps-log.de/sign
helgaK
Beiträge: 18
Registriert: Mo 16. Feb 2009, 22:58
Kontaktdaten:

Neues Problem: Eigenschaften Weiterleitung _blank

Beitrag von helgaK »

Hallo, leider konnte ich es mit den Hinweisen nicht lösen, denn inzwischen (contenido 4.8.12) hat sich das Navigations-Modul geändert, so dass ich nicht weiß, wo ich nun die erforderlichen Ergänzungen einfügen kann. hier das aktuelle Modul:

Code: Alles auswählen

<?php
/**
* $RCSfile$
*
* Description: 
* Main Navigation, displays Navigation from a starting idcat down to the max. level set.
* For now (as of 2009-01-12) all subcategories are put inside one <ul> and are assigned css classes 
* to distinguish level depth, first/last and active item property.
* 
* Module requires two client settings: 
* navigation_main_standard | start_idcat
* navigation_main_standard | level_depth
* 
* To modify the behaviour of the module (e.g. style of URL, CSS classes, ...), you need to edit Contenido_NavMain_Util::loopCats
* @see {frontend}/includes/Util/Modules/Contenido_NavMain_Util.class.php
*
* @version 1.0.0
* @author Rudi Bieller
* @copyright four for business AG <www.4fb.de>
*
* {@internal
* created 2009-01-12
* }}
*
* $Id: Navigation_Standard.php 3444 2009-01-19 11:42:59Z 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_NavMain_Util.class.php');

$iStartIdcat = getEffectiveSetting('navigation', 'idcat-home', 1);
$iSelectedDepth = getEffectiveSetting('navigation', 'level-depth', 3);

if ($iStartIdcat > 0) {
    $oFeNav = new Contenido_FrontendNavigation($db, $cfg, $client, $lang, $cfgClient);
    $oFeNav->setAuth($auth);
    $oFeNav->setRootCat($iStartIdcat);
    $oSubCategories = $oFeNav->getSubCategories($iStartIdcat, true, true, 1);
    // see if there are any subcategories to display
    if ($oSubCategories->count() > 0) {
        $aLevelInfo = array();
        $aDepthInfo = array();
        $aDepthInfo[0] = 0;
        $aDepthInfo[1] = $iSelectedDepth;
        foreach ($oSubCategories as $oSubCategory) {
            Contenido_NavMain_Util::loopCats($oSubCategory, $oFeNav, $tpl, $cfg, $lang, $aLevelInfo, intval($idcat), $aDepthInfo);
        }
        $tpl->generate('templates/navigation_standard.html');
    }
} else {
    echo '<p>Navigation not configured correctly.</p>';
}
?>


und hier die Class dazu:

Code: Alles auswählen

<?php
/**
 * Project:
 * Contenido Content Management System
 *
 * Description:
 * Recursive loop over given category for building a frontend navigation
 *
 * Requirements:
 * @con_php_req 5.0
 *
 *
 * @version    1.0.0
 * @author     Rudi Bieller
 * @copyright  four for business AG <www.4fb.de>
 *
 * {@internal
 *   created 2009-01-15
 *
 *   $Id: Contenido_NavMain_Util.class.php 969 2009-01-19 12:32:13Z rudi.bieller $
 * }}
 *
 */

class Contenido_NavMain_Util {
    /**
     * Recursive Loop over all (sub)categories.
     * Each level will be assigned a css class navmainStandardLevel_x
     *
     * @param Contenido_Category $oCategory
     * @param Contenido_FrontendNavigation $oFrontendNavigation
     * @param Template $oTpl
     * @param string $sUrlStyle
     * @param array $aCfg
     * @param int $iLang
     * @param array $aLevelInfo Information for marking active cat per levels
     * @param array $aDepthInfo Info on level depth / where to stop. Format: array(iCurrentLoopCount, iMaxLoopCount)
     * @return void
     */
    public static function loopCats(Contenido_Category $oCategory, Contenido_FrontendNavigation $oFrontendNavigation, Template $oTpl, array $aCfg, $iLang, array $aLevelInfo, $iCurrentPageIdcat, array $aDepthInfo = array()) {
    	$aDepthInfo[0] = isset($aDepthInfo[0]) ? $aDepthInfo[0] + 1 : 1;
    	$aDepthInfo[1] = isset($aDepthInfo[1]) ? $aDepthInfo[1] : 1;
        // display current item
    	$iItemLevel = $oFrontendNavigation->getLevel($oCategory->getIdCat());
    	if (!isset($aLevelInfo[$oCategory->getIdCat()])) {
    		$aLevelInfo[$oCategory->getIdCat()] = array();
    	}
    	$oCurrentSubcategories = $oFrontendNavigation->getSubCategories($oCategory->getIdCat());
    	$aLevelInfo[$oCategory->getIdCat()]['has_children'] = $oCurrentSubcategories->count() > 0;
    	$aLevelInfo[$oCategory->getIdCat()]['first_child_item'] = -1;
    	$aLevelInfo[$oCategory->getIdCat()]['last_child_item'] = -1;
        $bMarkActive = $oCategory->getIdCat() == $iCurrentPageIdcat || $oFrontendNavigation->isInPathToRoot($oCategory->getIdCat(), $iCurrentPageIdcat);
    	if ($oCurrentSubcategories->count() > 0) {
    		$aLevelInfo[$oCategory->getIdCat()]['first_child_item'] = $oCurrentSubcategories[0]->getIdCat();
    		$aLevelInfo[$oCategory->getIdCat()]['last_child_item'] = $oCurrentSubcategories[$oCurrentSubcategories->count()-1]->getIdCat();
    	}
    	// this is just for sample client - modify to your needs!
    	if ($aCfg['url_builder']['name'] == 'front_content' || $aCfg['url_builder']['name'] == 'MR') { 
    	    $aParams = array('lang' => $iLang, 'idcat' => $oCategory->getIdCat());
    	} else {
        	$aParams = array('a' => $oCategory->getIdCat(), 
        					'idcat' => $oCategory->getIdCat(), // needed to build category path
        					'lang' => $iLang, // needed to build category path
        					'level' => 1); // needed to build category path
    	}
    	// fill template with values
    	$oTpl->set('d', 'name', $oCategory->getCategoryLanguage()->getName());
    	$oTpl->set('d', 'css_level', $iItemLevel);
    	$oTpl->set('d', 'css_first_item', ($aLevelInfo[$oCategory->getIdParent()]['first_child_item'] == $oCategory->getIdCat() ? ' first' : ''));
    	$oTpl->set('d', 'css_last_item', ($aLevelInfo[$oCategory->getIdParent()]['last_child_item'] == $oCategory->getIdCat() ? ' last' : ''));
    	$oTpl->set('d', 'css_active_item', ($bMarkActive === true ? ' active' : ''));
    	try {
    	   $oTpl->set('d', 'url', Contenido_Url::getInstance()->build($aParams));
    	} catch (InvalidArgumentException $e) {
    	    $oTpl->set('d', 'url', '#');
    	}
    	$oTpl->next();
    	// continue until max level depth
    	if ($aDepthInfo[1] > $aDepthInfo[0]) {
        	// check if current item has sub-items to be displayed
        	$bShowFollowUps = ($oCategory->getIdCat() == $iCurrentPageIdcat || $oFrontendNavigation->isInPathToRoot($oCategory->getIdCat(), $iCurrentPageIdcat))
        							? true : false;
        	if ($bShowFollowUps === true && $oCurrentSubcategories->count() > 0) {
        		$oSubCategories = $oCurrentSubcategories;
        		foreach ($oSubCategories as $oSubCategory) {
        			self::loopCats($oSubCategory, $oFrontendNavigation, $oTpl, $aCfg, $iLang, $aLevelInfo, $iCurrentPageIdcat, $aDepthInfo);
        		}
        	}
    	}
    }
}
?>
Kann mir jemand weiterhelfen?
schon mal vielen Dank und viele Grüße
Helga
Gesperrt