jothanne

Members
  • Content count

    3
  • Joined

  • Last visited

Community Reputation

2 Neutral

About jothanne

  • Rank
    Newbie

Profile Information

  • Gender
    Not Telling
  • Location
    Germany
  1. jothanne

    @AndZyk - Thanks a lot, meanwhile I got it up and running. No surprise that it's more or less nearly the same as your last posted solution. <?php $albums = $page->repeater_gallery->getRandom(4); if (count($albums)) { foreach($albums as $album) { $image = $album->images_album->getRandom(); if ($image) { $imageUrl = $image->url; // Output } } } ?> The only flaw with this (for my special need) is, that if there are less albums as specified in the 'getRandom()' method, you do not get 4 images displayed. But since this will rarely occur I can live with it in the first place. Regards, Jochen
  2. jothanne

    @AndZyk - Thanks for your reply, the 'getRandom()' method is well known, but I think with your solution I only get 4 randomly choosen ALBUMS and not the desired 4 IMAGES out of ALL ALBUMS. But maybe I didn't grasped it right ... @szabesz - Thank you for the link, I've already seen this post but was a bit distracted by the JS an slideshow discussion in there. Maybe I can extract some parts to solve my problem. As far as I can see, a possible solution is to randomly choose a subset of 4 albums and in the next step select 1 ( only one) image out of all the images in the image field of each choosen album - hmmm ... Any further tips? Regards, Jochen
  3. I have a problem realizing a picture gallery with albums using repeater fields. Here is what I have: - The repeater field 'repeater_gallery' for all the albums - A text field 'album_name' in the repeater for the album name - An image field 'album_images' in the repeater for all the album images Now I'd like to pick a small selection of images (say 4) of ALL albums randomly and present them with their associated album name. How can this be done with the described repeater setup? Or is there a better way to realize such a gallery without repeaters? Thanks in advance for a little help.