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

    Is there a way I can retrieve a random thumbnail from a gallery based on the document id for use in ditto?

    Thanks,
    Michael
      • 7923
      • 4,213 Posts
      You can use this for example in the Ditto template: &view_gallery=`[+id+]` &order_by=`random` &limit=`1`.. or you could also use &gal_query_ids=`[+id+]` in place of the &view_gallery.. in &gal_query_ids it’s possible to define multiple galleries to search from.


        "He can have a lollipop any time he wants to. That's what it means to be a programmer."
        • 6573
        • 28 Posts
        Thankyou! That was exactly what I needed to know