Knowledge Drop

Can you do nested if in liquid?

  • 6 April 2021
  • 0 replies
  • 104 views

Userlevel 4

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.                

 


0 replies

Be the first to reply!

Reply