We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36426
    • 197 Posts
    Hi I'm trying to update this page to be a slideshow with Gallerific.

    http://www.virkdesigns.co.uk/bamboobikes/road-bikes.html

    I've tried JUST using Gallerific but can't get it to work. I also have tried to adapt the Gallery already on that page but that won't work either with Gallerific.

    Can anybody please help?

    My template code is:

    <!-- START Gallery with Placeholder image and thumbs -->
        [[!Gallery? &album=`[[*bike-gallery]]` &toPlaceholder=`gallery`]]
        [[!GalleryItem?]]
         
        [[+galitem.image:notempty=`<div class="image">
         <img class="[[+galitem.imgCls]]" src="[[+galitem.image]]" alt="[[+galitem.name]]" />
        </div>`]]
        [[+galitem:empty=`<div class="image">
        [[!getFirstImage? &album=`[[*bike-gallery]]` ]]
         <img src="[[+single.fullpath]]" alt="[[+single.description]]" />
        </div>`]]
         
         
        <div style="display: block; position: relative; overflow: hidden; margin: auto;">
        [[!+gallery:notempty=`
        [[+gallery]]
        `]]
        </div>
         
        <p> </p>
    <!-- END Gallery with Placeholder image and thumbs -->



    and my getFirstImage snippet code is:

    <?php
    $path = $modx->getOption('gallery.files_url');
         
        $album = $modx->getOption('album', $scriptProperties, false);
        if (!$album) { return ''; }
        if ($modx->getOption('checkForRequestVar',$scriptProperties,true)) {
            $getParam = $modx->getOption('getParam',$scriptProperties,'galItem');
            if (!empty($_REQUEST[$getParam])) { $id = (int)$_REQUEST[$getParam]; }
        }
        if ($id) { return ''; };
         
        $sql = "SELECT item.* FROM modx_gallery_items item
        INNER JOIN modx_gallery_album_items a ON item.id = a.item AND a.rank = 0
        WHERE a.album = :album";
         
        $stmt = $modx->prepare($sql);
        $stmt->execute(array('album'=> $album));
        $row = $stmt->fetch(PDO::FETCH_ASSOC);
        $stmt->closeCursor();
        $row['fullpath'] = $path . "" . $row['filename'];
         
        $modx->toPlaceholders(array('single' => $row));


    any ideas how to get this working with Gallerific or if there is another way to simple make the Gallery placeholder/GetFirstImage a slideshow instead?

    Thanks for any help.
      Yorkshire UK based hosting provider: https://www.simulant.uk