Community forum for knowledge and support

Updated last year

Conditional Statements Regarding Collection Items in Custom Code Fields

At a glance

The community member is asking if it's possible to use conditional statements regarding Collection Items in a custom code field, specifically inside the head of a collection page. The comments suggest that the community member has a collection that contains either an embedded form, a URL (e.g., to a PDF), or a URL to an external page. The community member would like the collection pages with a URL to have a < meta / > tag, and the pages with the embedded form to open as a normal page without refreshing or forwarding. A workaround suggested is to add a button on the collection page, which requires an extra click, but may be useful if someone stumbles onto the page from a search.

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