We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 28243
    • 3 Posts
    Hi guys,
    I got a ’references’-page, divided into 5 subcategories for different types of references. Each reference out of five has its own gallery. I now would like to only display 1 image representing each subcategory gallery. But upon click on 1 of those 5 images, lightbox should open and display all the images belonging to that subcategory. I do NOT want to list ALL the images of all subcategories all 2gether in one page, this is unfortunately what I’m getting with the script below :

    [!MaxiGallery? &gal_query_ids=`56,36,39,40,34` &display=`embedded` &embedtype=`lightboxv2` &order_by=`pos` &limit=`5`!]

    Is there a way to accomplish what I’ve tried to describe above?

    Help is much apprechiated :-(
    Thanks,
    Hendrik
      • 28243
      • 3 Posts
      Just to make sure I didn’t get too comlicated in my original posting wink:

      How can I have one (preview-) image representing an entire gallery? Upon click on that image, the gallery should open in lightboxv2 and ALL the images of that gallery can be browsed.

      Thanx,
      Hendrik
        • 7923
        • 4,213 Posts
        Lightbox only shows pictures for the links that are in the html source and MaxiGallery builds links only to the 5 pictures that it shows. The slidebox display mode will show all the pictures from the galleries.

        If you want to have the lightboxv2 display mode, you’d need to do something like this:

        1. call maxigallery once for each gallery and make it get only one picture:

        [!MaxiGallery? &gal_query_ids=`56` &display=`embedded` &embedtype=`lightboxv2` &order_by=`pos` &limit=`1` &galleryPictureTpl=`mgGalPicTpl`!]

        2. do a galleryPictureTpl chunk called mgGalPicTpl what contains:

        <a href="[(base_url)][+maxigallery.path_to_gal+][+maxigallery.picture.filename+]" rel="lightbox[set[+maxigallery.picture.gal_id+]]" title="[+maxigallery.picture.title:htmlent+] - [+maxigallery.picture.descr:htmlent+]">
        <img src="[(base_url)][+maxigallery.path_to_gal+]tn_[+maxigallery.picture.filename+]" class="thumbnail" title="[+maxigallery.picture.title:htmlent+] [+maxigallery.strings.click_to_zoom+]" alt="[+maxigallery.picture.title:htmlent+] [+maxigallery.strings.click_to_zoom+]" />
        </a>
        


        3. place the same snippet call second time for the gallery, but with a different template and limit value:

        [!MaxiGallery? &gal_query_ids=`56` &display=`embedded` &embedtype=`lightboxv2` &order_by=`pos` &limit=`99999` &galleryPictureTpl=`mgGalPicTplHidden`!]

        4. do a galleryPictureTpl chunk called mgGalPicTplHidden what contains:

        <a style="display:none;" href="[(base_url)][+maxigallery.path_to_gal+][+maxigallery.picture.filename+]" rel="lightbox[set[+maxigallery.picture.gal_id+]]" title="[+maxigallery.picture.title:htmlent+] - [+maxigallery.picture.descr:htmlent+]"> </a>
        


        So what all this will do is that it will show one picture from the gallery and then build "hidden" links from all the gallery pictures to the same lightbox picture set. It should work.


          "He can have a lollipop any time he wants to. That's what it means to be a programmer."
          • 28243
          • 3 Posts
          You are a genius! It worked!

          Thanx a lot!!!!!!!!!!!!!


          Best,
          Hendrik