Erstmal Danke für das Modul! )
Das problem ist, dass der etwas abenteuerliche "funktion-in-template"-code bei den normalen navigationen die felder ropic, nopic actpic quasi "doppelt belegt"... aber nicht bei der individuellen navigation, wofür der code wahrscheinlich mal gedacht war...
wie dem auch sei, unter 2.8.1 funktionieren die templates, wenn man zunächst überprüft, ob die benötigren *pic-felder überhaupt gesetzt werden müssen.
nav_graphicalnavi_activelinkable.tpl:
PHP-Code:
<?php
// Navigationsgrafiken laden
$this->import('Database');
$x=0;
foreach($this->arrData['items'] as $NaviItem) {
if(!isset($NaviItem->nopic) && !isset($NaviItem->ropic) && !isset($NaviItem->actpic)) {
$objPage = $this->Database->execute('SELECT nopic,ropic,actpic FROM tl_page WHERE title="' . $NaviItem['title']. '"');
$strNOPic = $objPage->nopic;
$strROPic = ($objPage->ropic!='') ? $objPage->ropic : $strNOPic;
$strACTPic = ($objPage->actpic!='') ? $objPage->actpic : $strROPic;
$boolACT = $objPage->actpic != '';
array_insert($this->arrData['items'][$x],0,array('nopic'=>$strNOPic,'ropic'=>$strROPic,'actpic'=>$strACTPic,'useAct'=>$boolACT));
}
$x++;
}
?>
<div class="graphicalnavigation">
<ul class="<?php echo $this->level; ?>">
<?php foreach ($this->items as $item): ?>
<?php if ($item['isActive']): ?>
<li class="active<?php if ($item['class']): ?> <?php echo $item['class']; ?><?php endif; ?>"><?php if($item['actpic']): ?><?php if($item['useAct']): ?><a href="<?php echo $item['href']; ?>" title="<?php echo $item['pageTitle'] ? $item['pageTitle'] : $item['title']; ?>"<?php if ($item['class']): ?> class="<?php echo $item['class']; ?>"<?php endif; ?><?php if ($item['accesskey'] != ''): ?> accesskey="<?php echo $item['accesskey']; ?>"<?php endif; ?><?php if ($item['tabindex']): ?> tabindex="<?php echo $item['tabindex']; ?>"<?php endif; ?><?php if ($item['nofollow']): ?> rel="nofollow"<?php endif; ?> onclick="this.blur();<?php echo $item['target']; ?>"><?php endif; ?><img src="<?php echo $item['actpic']; ?>" alt="<?php echo $item['link']; ?>" title="<?php echo $item['pageTitle']; ?>" class="active<?php if($item['class']): ?> <?php echo $item['class']; ?><?php endif;?>" <?php if($item['useAct']): ?>onmouseover="this.src='<?php echo $item['ropic']; ?>';" onmouseout="this.src='<?php echo $item['actpic']; ?>';"<?php endif; ?> /><?php if($item['useAct']): ?></a><?php endif; ?><?php else: ?><span class="active<?php if ($item['class']): ?> <?php echo $item['class']; ?><?php endif; ?>"><?php echo $item['link']; ?></span><?php endif; ?><?php echo $item['subitems']; ?></li>
<?php else: ?>
<li<?php if ($item['class']): ?> class="<?php echo $item['class']; ?>"<?php endif; ?>><a href="<?php echo $item['href']; ?>" title="<?php echo $item['pageTitle'] ? $item['pageTitle'] : $item['title']; ?>"<?php if ($item['class']): ?> class="<?php echo $item['class']; ?>"<?php endif; ?><?php if ($item['accesskey'] != ''): ?> accesskey="<?php echo $item['accesskey']; ?>"<?php endif; ?><?php if ($item['tabindex']): ?> tabindex="<?php echo $item['tabindex']; ?>"<?php endif; ?><?php if ($item['nofollow']): ?> rel="nofollow"<?php endif; ?> onclick="this.blur();<?php echo $item['target']; ?>"><?php if($item['nopic']): ?><img src="<?php echo $item['nopic']; ?>" alt="<?php echo $item['link']; ?>" onmouseover="this.src='<?php echo $item['ropic']; ?>';" onmouseout="this.src='<?php echo $item['nopic']; ?>';" /><?php else: ?><?php echo $item['link']; ?><?php endif; ?></a><?php echo $item['subitems']; ?></li>
<?php endif; ?>
<?php endforeach; ?>
</ul>
</div>
nav_graphicalnavi_activenununkabkle.tpl:
PHP-Code:
<?php
// Navigationsgrafiken laden
$this->import('Database');
$x=0;
foreach($this->arrData['items'] as $NaviItem) {
if(!isset($NaviItem->nopic) && !isset($NaviItem->ropic) && !isset($NaviItem->actpic)) {
$objPage = $this->Database->execute('SELECT nopic,ropic,actpic FROM tl_page WHERE title="' . $NaviItem['title']. '"');
$strNOPic = $objPage->nopic;
$strROPic = ($objPage->ropic!='') ? $objPage->ropic : $strNOPic;
$strACTPic = ($objPage->actpic!='') ? $objPage->actpic : $strROPic;
array_insert($this->arrData['items'][$x],0,array('nopic'=>$strNOPic,'ropic'=>$strROPic,'actpic'=>$strACTPic));
}
$x++;
}
?>
<div class="graphicalnavigation">
<ul class="<?php echo $this->level; ?>">
<?php foreach ($this->items as $item): ?>
<?php if ($item['isActive']): ?>
<li class="active<?php if ($item['class']): ?> <?php echo $item['class']; ?><?php endif; ?>"><?php if($item['actpic']): ?><img src="<?php echo $item['actpic']; ?>" alt="<?php echo $item['link']; ?>" title="<?php echo $item['pageTitle']; ?>" class="active<?php if($item['class']): ?> <?php echo $item['class']; ?><?php endif;?>" /><?php else: ?><span class="active<?php if ($item['class']): ?> <?php echo $item['class']; ?><?php endif; ?>"><?php echo $item['link']; ?></span><?php endif; ?><?php echo $item['subitems']; ?></li>
<?php else: ?>
<li<?php if ($item['class']): ?> class="<?php echo $item['class']; ?>"<?php endif; ?>><a href="<?php echo $item['href']; ?>" title="<?php echo $item['pageTitle'] ? $item['pageTitle'] : $item['title']; ?>"<?php if ($item['class']): ?> class="<?php echo $item['class']; ?>"<?php endif; ?><?php if ($item['accesskey'] != ''): ?> accesskey="<?php echo $item['accesskey']; ?>"<?php endif; ?><?php if ($item['tabindex']): ?> tabindex="<?php echo $item['tabindex']; ?>"<?php endif; ?><?php if ($item['nofollow']): ?> rel="nofollow"<?php endif; ?> onclick="this.blur();<?php echo $item['target']; ?>"><?php if($item['nopic']): ?><img src="<?php echo $item['nopic']; ?>" alt="<?php echo $item['link']; ?>" onmouseover="this.src='<?php echo $item['ropic']; ?>';" onmouseout="this.src='<?php echo $item['nopic']; ?>';" /><?php else: ?><?php echo $item['link']; ?><?php endif; ?></a><?php echo $item['subitems']; ?></li>
<?php endif; ?>
<?php endforeach; ?>
</ul>
</div>
What's your mileage with this fix? Sacht mal bescheid! )
Torben
Lesezeichen