Alternate text and images on desktop, but keep same order on mobile?

Hi everyone,

I’d like to have images and text blocks alternate on desktop (row 1: text left - image right, row 2: image left, text right, etc.), whereas on mobile, I’d like the order to remain the same (row 1: text, row 2:image, row 3: text, row 4: image).

So currently, on desktop, it looks like this, which is how I want it to be:

But on mobile, I want the image to move below the text, as per the red arrow:

Here’s the preview link for the site I’m creating.

Let me know if this can be done. Thanks in advance for your help!

Tim


Here is my site Read-Only: LINK
(how to share your site Read-Only link)

As it’s static content:

Design your item (img+text) using flexbox. And make sure there’s only 2 elements inside of your item. Add a class called for example .even to every other item. Then click on the flexbox button with two arrows to invert the order of the flexbox for mobile for .even items.

Would be even easier if it was dynamic content, you could have used the odd/even option for the dynamic item.

Hi Vincent,

Thanks a lot for your help. That seems to work until I get to the mobile landscape view (where I want to adjust the vertical order). There, the flex layout panel with that option disappears because the element becomes a flex child.

Desktop:

Tablet:

Mobile landscape:

Mobile portrait:

Let me know if you have a way to resolve this. Thanks!
Tim

hi @Tim_Metz here is short video what @vincent was explaining to you and it doesn’t work because of one small thing you did not make correctly.

https://cln.sh/t6Cxut

2 Likes

Hi Stan, thanks so much for the video and explanation! I’ve tried it out, but when I remove the flex setting from the section, it does affect the layout in the Desktop view.

I’ve recorded a short video here:

hi @Tim_Metz here is how to :wink:

https://cln.sh/pEOQKM

1 Like

Thanks Stan, this was perfect. All fixed now! :pray:

1 Like

Could these videos be made available again? If at least, can someone share documentation on these steps?

hi @Carlin_Desautels sorry I have now checked my video library but these videos are gone as I do delete these that are very specific and keeping only global solutions that may help in more situations.

In meantime there are many solved requests about alternating layouts or cloneable projects.

here are two examples:

or use input search field with keywords "alternating layout’ , "alternating grid layout’, “alternating CMS collection items” etc. :wink: If these sources will not help you solve your issue you can create a new request to get help.

Do you mind showing us what you did to achieve this? Very frustrating that the videos are gone as I have the exact same problem. Thanks

@Gfool I’m not sure what was in the vids, but here’s the approach I use for this design;

Hey Vincent. Isn’t this going to change the visual order, but not the DOM?

Of course, if it’s CSS, it can’t change the order in the DOM.