Alternating promo on article

Hi all,

A bit of a theoretical question (so no project link yet), but any advice would be really appreciated.

Looking to create a blog where we can add a promo area, with a few options to select from (each promotions a different area eg newsletter signup/info page).

My plan was for each post to contain two rich media areas, with the template page including a promo section in between.

In the CMS there will be an option field to choose either:
No promo
Promo 1
Promo 2

And the promos will have a conditional visibility based on this field.

The client has now asked about making the promo area an on/off toggle, that loads a random promo option.

Does anyone have any thoughts how I could make an areas visibility conditional, with multiple options that load at random within it?

Thanks! :slight_smile:

Does the random sort filter work for you?

Creating all the promos in one collection and adding that collection with one item showing at a time and showing randomly items.

1 Like

Oh thanks, good idea.

Am I right in thinking I would have a collection for the blog posts, and a second collection for the promo.

In the blog post template page I’d create a promo area, which would be connected to an on/off toggle in the blog post CMS.

And inside that promo area I’d insert one item from the promo collection with a random filter.

Have I got that right?

Thanks again!

Yes exactly thaf. The only thing is that in the promo area you need to add a collection wrapper connected to the promo collections and limit that collection to show just one.

Ok thanks, makes sense. :slight_smile:

Originally I was thinking the promos might be a bit different visually (eg one text only, centrally aligned and button, and a second with an image and left aligned text). I think I might have to simplify them to follow the same layout to work as a collection?

The design can be anything, at the end you’re just showing one so don’t worry.

Ok good to know.

Apologies if I’m missing something obvious, but for the promo collection would I set it up a bit like the inner workings in this: Creating multiple layouts for Webflow collection template pages - YouTube

Where the promo collection has a field to select a layout option. And the promo design has a couple of layouts within it, each with a visibility trigger. Or am I overcomplicating it and there’s an easier route?