We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 19227
    • 9 Posts
    Hi all.

    I’m trying to display a random image from a particular gallery using the following call:
    [!MaxiGallery? &gal_query_ids=`3` &order_by=`random` &limit=`1` &display=`pictureview`  &pictureTpl=`maxiImg`  !]

    This works fine on the page of the gallery itself (3), but I’d also like to put it on other pages (where it doesn’t work).

    The same call without &display=`pictureview` does work on all pages (but obviously outputs the thumbnail, rather than the image itself):
    [!MaxiGallery? &gal_query_ids=`3` &order_by=`random` &limit=`1` !]


    Is is possible to use
    display
    and
    gal_query_ids
    together?
    Perhaps I’m misunderstanding display=`pictureview`?

    Any help is much appreciated.

    Cheers,
    Mike
      • 7923
      • 4,213 Posts
      No, you cannot query for thumbnails and then use the pictureview display type. In your example you are limiting the results to just one, but there could be several thumbnails returned and the script can’t render all them in pictureview.. the pictureview display type is meant for just one picture.

      But can’t you use the normal display type and do a custom &galleryPictureTpl with the content of "maxImg"? (minus the template code for next/prev/index links, because those placeholders does not exist in galleryPictureTpl). You can also do a custom &galleryOuterTpl to get rid of the manage button etc.

      EDIT: Typo..


        "He can have a lollipop any time he wants to. That's what it means to be a programmer."
        • 19227
        • 9 Posts
        Thanks very much Doze, that was exactly what I needed to do.