Redaxo-Galerie mit Beschreibungstext
Hier ein Beispiel, wie man einen im Medienpool unter „Beschreibung” eingetragenen Text zu einen Bild in einer beliebigen Lightbox-Galerie ausgeben kann.
Im Download ist die Milkbox 2 enthalten, durch anpassen der config.inc des Addons und des Bildaufrufs im Modul kann man problemlos andere Lightbox-Varianten einbinden.
Beispiel:
http://fcb-woerth.de/galerie/aktivitaet/
Hier kommt die Fancybox 2 zum Einsatz.
Download:
Moduleingabe:
<strong>Bilder auswählen</strong><br/> REX_MEDIALIST_BUTTON[1] <div id="REX_MEDIALIST_PREVIEWC" style="display:none;margin-bottom:25px;">Vorschau:<br /> <img id="REX_MEDIALIST_PREVIEW" src="../files/clear.gif" alt="Vorschau" title="Vorschau" /></div><br/> <strong>Bildgröße:</strong><br/> <input type="text" name="VALUE[1]" value="REX_VALUE[1]" size="20" class="inp100" /><br/> <br/> Titel und Bildbeschreibung können im Medienpool eingegeben werden.
Modulausgabe:
<?php if ("REX_MEDIALIST[1]" != "") { echo "\n".'<div class="galerie">' . "\n"; unset($rxmodule); // Bilddateien aus Medialist $rxmodule['imagelist'] = explode(',', trim("REX_MEDIALIST[1]")); // maximale Bildgröße $rxmodule['imgsize'] = trim("REX_VALUE[1]"); if ($rxmodule['imgsize']=='') { $rxmodule['imgsize'] = '185a'; } // Zufallszahl für Ausgabe srand((double)microtime()*1000000); $rxmodule['random'] = rand (100,900) . rand (100,900); // Links für die Bilder ausgeben foreach ($rxmodule['imagelist'] as $rxmodule['file']) { $rxmodule['media'] = OOMedia::getMediaByName($rxmodule['file']); $fileDescription = $rxmodule['media'] ->getValue('med_description'); if ($rxmodule['media']) { $rxmodule['mediatitle'] = str_replace(array("\r\n", "\n", "\r"), ' ', $rxmodule['media']->getValue('title')); if (trim($rxmodule['mediatitle']=='') or !$rxmodule['mediatitle']) { $rxmodule['mediatitle'] = $rxmodule['file']; } echo '<div class="galeriebild"><a rel="milkbox:lb'.$rxmodule['random'].'" href="'.$REX['HTDOCS_PATH'].'files/'.$rxmodule['file'].'" title="<b>'.$rxmodule['mediatitle'].'</b><br/>'.$fileDescription.'"><strong>'.$rxmodule['mediatitle'].'</strong><br/> <img src="'.$REX['HTDOCS_PATH'].'index.php?rex_resize='.$rxmodule['imgsize'].'__'.$rxmodule['file'].'" alt="' . $rxmodule['mediatitle'] . '" /></a></div>'."\n"; } } echo '</div>' . "\n"; } ?>
Sabrina Bauch
Geprüfte Mediendesignerin
Richard-Wagner-Str. 35
76744 Wörth
07271 129737
Quellen: