CMS Items -- conditional visibility on whole page?

Hi there!

I have a project that is using a CMS collection for ‘Partners’

There is a toggle within the CMS collection that toggles between an ‘actual partner’ and an ‘example partner’.

For ‘actual partners’ I would like to keep the item template page live and indexable by Google – but for the ‘example partners’ – I am using these as leads to a lead generation form – and I don’t want to actually display/index/publish the item template pages.

Is there any way around this?
I thought about adding the “no robot” html tag in the header of the item template – but this would also remove indexing from the ‘actual partners’ – whereas ideally these remain published and indexable.

Any advice is greatly appreciated.

Best wishes,
Patrick

In your collection, add a Robots select, with two options;

  • noindex, for pages you want to block robots
  • all for pages you want to allow robots

Those two should be enough but there are others.

Set this field to required in your collection, and populate every record to make certain it’s one of those two values.

Then in your collection page head, create your robots META and for the value, insert the select field you’ve created above.