<![CDATA[ Displaying only one picture picked randomly ? - My Forums]]> https://forums.modx.com/thread/?thread=96723 <![CDATA[Displaying only one picture picked randomly ?]]> https://forums.modx.com/thread/96723/displaying-only-one-picture-picked-randomly#dis-post-523428
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.]]>
Jul Mar 26, 2015, 01:57 PM https://forums.modx.com/thread/96723/displaying-only-one-picture-picked-randomly#dis-post-523428
<![CDATA[Re: Displaying only one picture picked randomly ?]]> https://forums.modx.com/thread/96723/displaying-only-one-picture-picked-randomly#dis-post-523568 The &order_by=`random` was already there, but I had missed the &limit=`1`.]]> Jul Mar 28, 2015, 04:08 PM https://forums.modx.com/thread/96723/displaying-only-one-picture-picked-randomly#dis-post-523568 <![CDATA[Re: Displaying only one picture picked randomly ? (Best Answer)]]> https://forums.modx.com/thread/96723/displaying-only-one-picture-picked-randomly#dis-post-523458
&order_by = `random`
&limit = `1`
]]>
BobRay Mar 26, 2015, 11:32 PM https://forums.modx.com/thread/96723/displaying-only-one-picture-picked-randomly#dis-post-523458