Community forum for knowledge and support

Updated 7 months ago

Approach to download data from cms and alternate display of graphics

At a glance

Hey Guys, How would you approach this? I want to download data from the cms and alternate the display of graphics. I don’t want to have to add separate graphics for the right and left versions.

1
T
A
A
4 comments

I've used some custom code in the past to achieve this, so you'd set up your CMS with Image/Title/Blurb/Link and then add a separate Code Embed to the page (or sitewide) and have it something along the lines of below;

.collection-item:nth-child(even) { flex-direction: row-reverse; }

Add a switch in the CMS (for example “its left”) and then you call that with custom class in the layout

how would you make this work if the images & content stack on a smaller breakpoint?

the best way is to use the nth-child and change the css just as Tom suggested above. Using a switch in CMS is another way but not optimal as you will have to manually change that and you can't really sort or move things around without having to go back to the CMS and altering the switch

Add a reply
Sign up and join the conversation on Slack