Can you do nested if in liquid?

Knowledge Drop

Last tested: Jan 21, 2019

Yes! Source though it may be less confusing if move one of the conditions into a new field like a yesno:

{% if template == "index" or template == "page" %}
{% assign correct_template = true %}
{% endif %}
{% if correct_template and settings.slideshow_enabled %}
<div class="container main content">...</div>
{% endif %}

This content is subject to limited support.                

Version history
Last update:
‎04-05-2021 09:03 AM
Updated by: