[hit_graphical_navigation] und TL 2.8 RC2
Hallo,
hat jemand schon erfolgreich [hit_graphical_navigation] und TL 2.8 RC2 getestet?
Bei mir geht es nicht - mit TL 2.7.6 geht es aber.
Ich denke, dass der Fehler im Template steckt:
HTML-Code:
<?php
// Navigationsgrafiken laden
$this->import('Database');
$x=0;
foreach($this->arrData['items'] as $NaviItem) {
$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'][0]; ?>" 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'][0]; ?>';" onmouseout="this.src='<?php echo $item['actpic'][0]; ?>';"<?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'][0]; ?>" alt="<?php echo $item['link']; ?>" onmouseover="this.src='<?php echo $item['ropic'][0]; ?>';" onmouseout="this.src='<?php echo $item['nopic'][0]; ?>';" /><?php else: ?><?php echo $item['link']; ?><?php endif; ?></a><?php echo $item['subitems']; ?></li>
<?php endif; ?>
<?php endforeach; ?>
</ul>
</div>
Im Frontend gibt es folgendes:
HTML-Code:
<img onmouseout="this.src='Array';" onmouseover="this.src='Array';" class="active first" title="" alt="ABC" src="Array">
Wer kann mir bitte helfen?
Danke und Gruß
Frank Hüttner
Mit 2.8.1 funktionieren folgende templates
Erstmal Danke für das Modul! :o)
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! :o)
Torben
[hit_graphical_navigation] und 2.8.1
die Lösung von Frank funktioniert (danke!)
allerdings (wie juergen schon sagte) verschwindet bei 2.8.1 dann bei aktivem link die grafik beim hover auch bei mir
hat da jemand schon die lösung?
Tobi
neues Fenster geht nicht auf...
Hallo Alle zusammen,
habe grad diese schöne Erweiterung benutzt - nur ging dann die Einstellung "open link in new window" nicht mehr - was ja bei externen Links ein wenig doof ist.
Nachdem ich die Zeile
"onclick="this.blur();"
aus dem Template gelöscht hab (kommt dreimal drin vor) funktionierts.
Ob das nun die Lösung oder nur ein brauchbares Workaround ist, weiß ich grad nicht, wollte abber meine Erkenntnisse mit der Welt teilen!
Frohes Fest,:cool:
Bigga