I’m sure something like this is possible - I just can’t figure out for the life of me using CMS Collections.
Currently I’m using a multi-image collection to upload project images.
I’d like to alternate between showing one full screen image and showing two side by side.
The side by side view would need to stack on mobile view otherwise the images would be too small.
I’d like to be able to control which images are 2 up and which are 1 up per item and per page as each page will have a different, unpredictable curation of images.
How would I go about getting this to work pulled from one bucket of images in the CMS?
My one thought is to create all 1 up and two up versions for each image. Then I can use an HTML embed using nth CSS selectors to specify which to toggle visible or not. I could also use the designer to change what is seen on different screen sizes.
However this seems like a long winded and non-performant way of achieving something simple.
Totally open to just not using a multi-image collection but unsure how I’d keep image uploading into the CMS simple per page.
By the way, to simply stack those image on mobile you can just apply display flex (to keep the spacing) or you can again edit the grid properties as you need.
By the way, way add a class you may ask. Because wherever that class is present on the child, that child has to stretch. Class name should come from CMS with for each data.
Create a style as below and add this class as data value for the child that you want to stretch. And then apply JS instruction above. By the way, JS script will only work(display) on live site.
For anyone else who needs to achieve the same thing I managed to do it by using CSS selectors to count the number of sibling elements. Then depending on the # of siblings I’d span cols differently