Jump to content

jothanne

Members
  • Posts

    6
  • Joined

  • Last visited

Everything posted by jothanne

  1. Hi kongondo, your understanding is completely right. Sadly to read that this isn't realizable the described way - but I suspected something like that. So I went the way with my initially described - now not so - 'temporary workaround'. It seems that my fault was to think of the repeaters as a special kind of subpages-layer with a somehow similar behavior. OK - maybe the future will bring this feature since I'm a big fan of the repeater-technique and the associated clear arrangement in the pages tree of the user interface. Thank you for your efforts to clarify the issue.
  2. Hi kongondo, Thanks a lot for your reply! Yes - the type_repeater (repeater field) contains the repeater-field color_repeater. I saw this 'Custom PHP Option' and suspected that might be the way to go, but can't really find out, how to adapt this for my use case. Maybe you can give me a hint or a small code example to do the trick.
  3. I have the following page and field setup: root_page (Page) | |- colors_page (Page) | | | |- type_repeater (Repeater Field) | | | |- color_repeater (Repeater Field) | |- colorname_text (Text Field) | |- coloropt_options (Select Options Field / Multiple values) | (1=usable, 2=preferred) | |- products_page (Page) | |- product_repeater (Repeater Field) |- product_color (Page Reference Field) Now i want to fill the entries of the 'product_color'-field with only the color names ('colorname_text'-field) of the colors which are 'usable' (value=1) corresponding to the 'coloropt_options'-field within the nested repeaters 'type_repeater' and 'color_repeater' of the 'colors_page'. I researched and tried a lot, but cant't really get around this problem. As a temporary workaround i replaced the repeater fields by subpages - but that isn't what i want in the end. And now i hope for a helping hand to give me the essential advice or hint. Thanks a lot in advance.
  4. @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
  5. @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
  6. 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.
×
×
  • Create New...