Thread tagged as: Question, Discussion

Repeaters, sorting and populating image layouts...

Am using repeaters for a client to populate a project 'galleries'. There are four image "layouts"... 1up. 2up. 3up and 2up 3/4. And different number of images per project, displayed in a single page. So repeaters should be good option.

If I separate each layout type then add as it's own repeater, you can only sort WITHIN the repeater. So the order can only be the order I add into template... 1up 1up 1up 2up 2up 3up 3up etc. Else, if you could drag and drop sort the reapting regions this would work perfectly!

If I add all 4 layouts into one repeater and allow client to populate the layouts they need then add more, you end up with a very long page of empty fields for the positions they don't want. (also have a bug with this option will post separately).

Am I going about this the wrong way?

Is there a way to add a selector in CMS to select the type (layout) of repeating region you want to add AND hidefields from template in CMS unless selected from drop down?

Does the Gallery App add more control with layouts that we could populate and add slug in page to view?

Stuart Farrell

Stuart Farrell 0 points

  • 7 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

I don't understand why you can't reorder the items within your region - those are drag and drop, just like items within a repeater.

I have items in the region, which I can reorder yes, but I'm talking about within an item. (prob should have explained that).

So inside an item, I need a way to manage populating different image layouts to build a page full of images. There are 4 different "layouts" (1up, 2up 3up etc). So I made these 4 a repeating region that can be populated, but am left with a slightly messy/long content mangement. (and a bug posted separately).

What really want is a way to "Add" images into the page by:

  1. Selecting add from repeating region
  2. Selecting layout option *
  3. Populating with images
  4. Able to resort repeating regions

No. 4 is not vital but would be great. No. 2 is the challange - how to hid the layouts not selected to make population more streamlined and managable.

Is this possible?

Rachel Andrew

Rachel Andrew 394 points
Perch Support

Choosing a layout option isn't something we tackle in Perch. I think you are really heading into the realms of needing to create a custom solution here. You are going to run into issues of handling large numbers of file inputs which, as you have seen, can be problematic.

Repeaters are designed for relatively small amounts of data - a single image and information about it, a table or list row, a single product. That kind of thing.

OK, so now way to hide editable content in Perch unless a value is true in a select? May have to stick with the way I'm doing it...

  • Being able to sort repeatable regions would be nifty... add to nice to have list?? *