müsste so aussehen (3. Zeile):
- Code: Alles auswählen
<div class="navi">
REX_TEMPLATE[4]
<?php
$options = array('showLangCodeOnly'=>1, 'separatorTag'=>'span');
echo createLangNav($options);
?>
</div>
<div class="navi">
REX_TEMPLATE[4]
<?php
$options = array('showLangCodeOnly'=>1, 'separatorTag'=>'span');
echo createLangNav($options);
?>
</div><?php
function createLangNav($options_user='')
{
if(!is_array($options_user))
$options_user=array();
$options = array(
'showLangCodeOnly' => false, // {boolean} Soll nur die Abgekürzte Version angezeigt werden, zBsp. 'De', 'Fr' usw.
'showDescription' => false, // {boolean} Soll für die Sprachnavigation eine Beschreibung ausgegeben werden? zBsp: Sprache
'description' => 'Sprache', // {string} String der als die Beschreibung ausgegeben wird
'addSeparator' => false, // {boolean} Soll zwischen jedem Navigationselement ein Trennzeichen angezeigt werden? (Nur falls 'displayAsList'=> false
'separatorChar' => '|', // {string} Trennzeichen
'separatorTag' => 'span', // {string} Tag welches das Trennzeichen umschliesst
'separatorTagClass' => '', // {string} Klasse für das Trennzeichen-Tag
'renderImages' => false, // {boolean} Soll Navigation mit dem Schriftersetzungs-Addon SleightOfHand von Dave Holloway ausgegebn werden?
'renderFontfile' => 'univers.ttf', // {string} Name der zu verwendenden Schrift-Datei (schaue Dokumentation SleightOfHand)
'renderFontsize' => 12, // {int} Schriftgrösse (nicht pixelgenau!)
'renderFontspacing' => 1, // {int} Zeilenabstand
'renderFontcolor' => array(42,41,46), // {array(R,G,B)} RGB-Farbwert der Schrift
'renderFontactivecolor' => array(255,255,255) // {array(R,G,B)} RGB-Farbwert der Schrift bei einem mouseover-Event
);
// Extending defaults array with user options
foreach ($options_user as $key => $val)
if(isset($options[$key]))$options[$key] = $val;
$invalidGets = array('clang','article_id');
foreach($_GET as $key=>$val)
{
if(!in_array($key,$invalidGets))
$string .= ($string=="") ? $key."=".$val : "&".$key."=".$val;
}
global $REX;
foreach($REX['CLANG'] as $key=>$lang)
{
if($options['showDescription'] && $out!="") $out .= '<span class="langtitle">'.$options['description'].'</span> ';
if($options['addSeparator'] && $out!="")
{
$out .= ' <'.$options['separatorTag'];
if($options['separatorTagClass'])
$out .= ' class="'.$options['separatorTagClass'].'"';
$out .= '>'.$options['separatorChar'].'</'.$options['separatorTag'].'> ';
}
$text = ($options['showLangCodeOnly']) ? substr($lang,0,2) : $lang ;
if($options['renderImages'] && OOAddon::isAvailable('sleightofhand'))
{
if($REX['CUR_CLANG']==$key)
$out .= a561_sleightofhand(array(
'text' => $text,
'link' => rex_getUrl($curArtId,$key),
'font' => $options['renderFontfile'],
'color' => $options['renderFontactivecolor'],
'size' => $options['renderFontsize'],
'spacing' => $options['renderFontspacing']
));
else
$out .= a561_sleightofhand(array(
'text' => $text,
'link' => rex_getUrl($curArtId,$key),
'font' => $options['renderFontfile'],
'color' => $options['renderFontcolor'],
'mouseover' => $options['renderFontactivecolor'],
'size' => $options['renderFontsize'],
'spacing' => $options['renderFontspacing']
));
}
else
{
$out .= '<a href="'.rex_getUrl($curArtId,$key). '?' .$string. '" title="'.$lang.'" id="lang'.$key.'"';
if($REX['CUR_CLANG']==$key) $out .= ' class="active"';
$out .= '>'.$text.'</a>';
}
}
return $out;
}
?><div id="head-navigation">
REX_TEMPLATE[4]
<php
$options = array('showLangCodeOnly'=>1, 'separatorTag'=>'span');
echo createLangNav($options);
?>
matze hat geschrieben:Hi
hab gerade das template ynav ausprobiert.
ich finde die funktionen echt super und hut ab vor dem der das geschrieben hat.
leider hab ich das problem, dass es jeden menüpunkt mit der artikel id 1 verlinkt!
hab zwar schon einiges ausprobiert aber will einfach net funktionieren!!
hat jemand vielleicht eine lösung?
wäre euch echt dankbar.
lg Matthias
Notice: Undefined index: nav in htdocs/redaxo/include/generated/templates/8.template on line 55
Notice: Undefined variable: subNavCounter in htdocs/redaxo/include/generated/templates/8.template on line 128
Notice: Undefined variable: subNavCounter in htdocs/redaxo/include/generated/templates/8.template on line 139
Notice: Undefined index: 1 in htdocs/redaxo/include/generated/templates/8.template on line 139
Notice: Undefined index: 2 in htdocs/redaxo/include/generated/templates/8.template on line 128
Notice: Undefined index: 2 in htdocs/redaxo/include/generated/templates/8.template on line 139
Notice: Undefined index: 3 in htdocs/redaxo/include/generated/templates/8.template on line 128
Notice: Undefined index: 3 in htdocs/redaxo/include/generated/templates/8.template on line 139
Notice: Undefined index: 4 in htdocs/redaxo/include/generated/templates/8.template on line 128
Notice: Undefined index: 4 in htdocs/redaxo/include/generated/templates/8.template on line 139
Notice: Undefined index: 7 in htdocs/redaxo/include/generated/templates/8.template on line 128
Notice: Undefined index: 7 in htdocs/redaxo/include/generated/templates/8.template on line 139
Notice: Undefined index: 8 in htdocs/redaxo/include/generated/templates/8.template on line 128
Notice: Undefined index: 8 in htdocs/redaxo/include/generated/templates/8.template on line 139
Notice: Undefined index: 9 in htdocs/redaxo/include/generated/templates/8.template on line 128
Notice: Undefined index: 9 in htdocs/redaxo/include/generated/templates/8.template on line 139
Notice: Undefined index: 10 in htdocs/redaxo/include/generated/templates/8.template on line 128
Notice: Undefined index: 10 in htdocs/redaxo/include/generated/templates/8.template on line 139
<?php
$options = array('addSubNav'=>1, 'dropDown'=>1, 'addItemId'=>1, 'useArticleId'=>1);
$navs = createNav($this,$options);
echo $navs[nav];
echo $navs[subnav];
?>darwin hat geschrieben:hab grad mal versucht die yNav 1:1 vom Downloadbereich in eine REX 4.3
zu testen. Hier wirfts mir ettliche Fehler
Zurück zu Templates/Navigationen [R4]
Mitglieder in diesem Forum: krischna und 0 Gäste