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.
Here is my site Read-Only: [LINK]
([how to share your site Read-Only link])
: Read only link here
: Share a read-only link | Webflow University
You can easily do that by applying Grid system on the parent. I was editing a template for similar requirements, please check the screenshot.
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.
How would this work if every page has a different set of images? E.g
1 up, 2 up, 1 up
2 up, 1 up, 1up
If i’m not mistaken this would mean that every page would have the exact same grid pattern of images?
Oh ya, according to Webflow template system (CMS Collection page) every page will have same thing.
I have not done this, but if we can add a class to child elements then it should work. This option is not available inbuilt but I’ve found a way with JS, read this topic here Add dynamic class name on collection lists - #5 by Lucas_Wild
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.
grid-area: span 1 / span 2 / span 1 / span 2;
Awesome thanks I will give it a go and report back