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

    I'm trying to display only one large picture, randomly picked with MaxiGallery, and without the paging information.

    I assumed that I had to use the "pictureview" service, but it seems ignoring the "galleryOuterTpl" and "outerTpl" parameters, and is always calling the outer template stored in "galleryoutertpl.html".
    [!MaxiGallery? &lang=`fr-utf8` 
    &display=`pictureview` 
    &galleryOuterTpl=`@FILE:assets/snippets/maxigallery/templates/galleryOuterTpl.tpl` 
    &galleryPictureTpl=`@FILE:assets/snippets/maxigallery/templates/galleryPictureTpl.tpl` 
    &max_thumb_size=`154x108` 
    &max_pic_size=`1024x720`  !]


    If no picture is available for the current document, I also would like some picture to be obtained from a gallery associated to any parent or child document.
    The "pictureview" service unfortunately seems to ignore the "gal_query_ids" and "childgalleries_level_limit" parameters.

    I have a working alternative, which is using the default thumbnails service of MaxiGallery to display the large picture, and to use the `pictureview` service to only display a "Manage pictures" button:
    <!--Printing some "Manage pictures" button -->
    [!MaxiGallery? 
    &lang=`fr-utf8` 
    &display=`pictureview` 
    &max_thumb_size=`154x108` 
    &max_pic_size=`1024x720` 
    &pics_per_row=`3` 
    &pictureTpl=`@FILE:assets/snippets/maxigallery/templates/manageButton.tpl` &css=`@FILE:` !]
    
    <!--Printing several large pictures instead of thumbnails -->
    [!MaxiGallery? &lang=`fr-utf8` 
    &gal_query_ids=`[*gal_ids*]` 
    &childgalleries_level_limit=`1`
    &order_by=`random` 
    &max_thumb_size=`154x108` 
    &max_pic_size=`1024x720` 
    &pics_per_row=`3` 
    &galleryOuterTpl=`@FILE:assets/snippets/maxigallery/templates/galleryOuterTpl.tpl` 
    &galleryPictureTpl=`@FILE:/assets/snippets/maxigallery/templates/galleryPictureTpl.tpl` 
    &js=`assets/snippets/maxigallery/js/galerie.js` 
    &css=`@FILE:` 
    &manageOuterTpl=`CODE:` !]

    This works fine excepted that all pictures from the gallery are printed, which means too much bandwdith. Would there be a way to limit the number of pictures printed to only one?

    Thanks.

    This question has been answered by BobRay. See the first response.

    • discuss.answer
      • 3749
      • 24,544 Posts
      Try adding these to the tag:

      &order_by = `random`
      &limit = `1`
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
        • 15001
        • 697 Posts
        Thanks a lot, Bob. That's it.
        The &order_by=`random` was already there, but I had missed the &limit=`1`.