Community forum for knowledge and support

Updated 12 months ago

Conditional Statements Regarding Collection Items in Custom Code Fields

At a glance

Does anyone know if it's possible to use conditional statements regarding Collection Items in a custom code field? (actually inside the head of a collection page)?

J
2 comments

Something along the lines

if item X exist then do X

I have a collection that either contains an embed form, a URL (ie. to a PDF) or a URL to an external page. And I would like that the collection pages with an URL would have a <meta /> on the pages with URLs. The pages with the embedded form should open as a normal page and not refresh/forward. Hence the need for a conditional statement.

Workaround is a to add a button on the collection page – requires a extra click, but it's mostly if someone stumbles into the page from search.

Add a reply
Sign up and join the conversation on Slack