liquid templates are not updated if the snippet is inside of a conditional statement

192 Views Asked by At

Once you update the snippet that is included in the page, unless a developer updates the pages the changes on the pages (snippet changes) are not taken the place. So at the moment to trigger snippet change, here is the workflow:

=> update snippet content
=> update page (change something, click save)
=> hard reload the page in the browser to that change

Actually, I wasn't able to figure out why if a snippet is in conditional statement the snippet is not updated by default, when changed.

So here is my page:

{% if entry.category == 'Recipes' %}
  {% assign body_class = 'recipes' %}
{% else %}
  {% assign body_class = 'nutrition article' %}
{% endif %}

{% extends 'index' %}

{% block 'halo/breadcrumbs' %}
  Home>
  Nutrition>
  {{ entry.title }}
{% endblock %}

{% block 'wrapper/main-content' %}
  {% if entry.category == 'Recipes' %}
    {% include 'recipes-content' %}
  {% else %}
    {% include 'nutrition-content' with entry_slug: entry._slug %}
  {% endif %}
{% endblock %}

And the snippet is inside if else statement

{% include 'recipes-content' %}

Which is not updated automaticaly, I need to any character to the page, save it, then remove it, then save it again.

That is fine for a single page however the issue arises when there are more than one page that will require an update.

The workflow is as above at the moment.

0

There are 0 best solutions below