I am prototyping about 15+ pages which all look similar but need to include a partial with fields that are included based on a variable.
To make it more clear it is a search section for different user roles and the role and page defines if a certain filter should be shown on that page. There are many filters.
I want to create just one variable per page like:
page:
—
search: news
—
and then in the partial I want to check with each field if it should be shown:
- if current_page.data.search == "news" OR "events" OR "whatever"
// show this filter
Obviously this doesn’t work. I can only get it working if the condition is one string and an exact match of the variable.
Is there a way to make this work, so I don’t have to create a huge list of variables on the page?