madeyourday/contao-rocksolid-custom-elements

Bildergalerie mit 1 Thumbnail

Closed this issue · 2 comments

Ist es möglich einen ganzen Ordner auswählen zu können - und das nur 1 Thumbnail angezeigt wird und auf Klick in der Lightbox alle Fotos vom Ordner ausgegeben werden.

Momentan hab ich ein Foto (das sich in der Lightbox öffnet) mit einem Text darunter.

Mein momentaner code:

rsce_galerie.html5:

<?php foreach ($this->members as $member): ?>
 
 
                     <div class="col-xl-3 col-lg-6 col-md-6">
                             <?php if ($image = $this->arrData['getImageObject']($member->image)): ?>
 <a data-lightbox="<?php echo $this->id ?>" href="<?php echo $image->singleSRC ?>">
     <img src="<?php echo $image->src ?>" alt="<?php echo $image->alt ?: $member->name ?>"<?php echo $image->imgSize ?>>
 </a>
<?php endif ?>

                             <p style="font-weight:bold;"><?php echo $member->text ?></p>
                     </div>
 <?php endforeach ?>

rsce_galerie_config.php:

<?php

return array(
   'label' => array(
       'de' => array(
           'Galerie',
       ),
   
   ),
   'types' => array('content'),
   'contentCategory' => 'texts',
   'standardFields' => array('headline', 'cssID'),
   'fields' => array(
       'members' => array(
           'label' => array(
               'de' => array(
                   'Galerie',
                   'Fügen Sie eine neue Baustelle ein.',
               ),
           ),
           'elementLabel' => array(
               'de' => 'Baustelle %s',
           ),
           'inputType' => 'list',
           'fields' => array(
               'image' => array(
                   'label' => array(
                       'de' => array('Bild', ''),
                   ),
                   'inputType' => 'fileTree',
                   'eval' => array(
                       'fieldType' => 'radio',
                       'filesOnly' => true,
                       'extensions' => 'jpg,jpeg,png,gif,svg',
                   ),
               ),
               
               'text' => array(
                   'label' => array(
                       'de' => array('Text', ''),
                   ),
                   'inputType' => 'text',
                   'eval' => array('tl_class' => 'w200'),
               ),
               
               
               
               
           ),
       ),
   ),
); 

ausi commented

Zu diesem Thema gibt es bereits einen Beitrag im Contao-Community-Forum: https://community.contao.org/de/showthread.php?81360