Difficult to search the database on the words 'and' and 'or' so apologies if this is already answered somewhere. :)
I would like to exclude the top nav bar from multiple pages in our website, i.e., [%if page != page1 AND page != page2%]. What is the syntax for this? Could it be added to the FAQ?
Sure thing, you can exclude the top nav on certain pages using the comparison and logic operators listed in our Liquid Basics documentation (which also includes examples).
Using your top nav example, you can use something like the following Liquid conditional:
{% if page.slug != 'page1' and page.slug != 'page2' %}
{% include "nav" %}
{% endif %}
If you need any assistance troubleshooting, feel free to email [email protected] with a link to the relevant file and a member of our theme support team will follow up.
Showing 1 reaction
Sign in with