As far as I can tell from poking around, `{% include %}` is not supported within a `{% render %}`ed snippet, so if a Legacy Section Theme updates to using `{% render %}` for snippets prior to the full release of the new storefront, that will mean any apps that are relying on `{% include %}` within these snippets won't work - is that correct?
@ThibautCyou said...
While {% include %} is deprecated, it will not be removed from the platform, as we don't break backward compatibility in the Liquid/Theme API.
I came across this screenshot "in the wild" this morning. Am I misunderstanding or did this roll out as a breaking change for some stores? As an app developer with thousands of customers relying on "include", I'm extremely concerned about this. Is my concern unfounded? I don't yet have support requests about this but I don't know if I should be expecting them to start rolling in at any moment.
While the behavior of {% include %}
remains unchanged, when a theme adopts {% render %}
, it changes the behavior of snippets in a manner that can be breaking certain apps. We've communicated this in our changelog, and will hold off on using {% render %}
in Debut and all theme store themes until Feb 17, 2020.
You can use the {% capture %} tag to capture the output of the {% render %} and use it in the parent template. In cases where you have multiple resulting values, we recommend either splitting your snippet into multiple snippets, or inlining the code.
Would you consider adding this directly to the {% render %} tag as a shortcut, like:
{% render 'snippet' to result with value as internal_variable %}
will call snippet snippet and capture its output to the variable result?
I guess this could be useful (and then supercool if snippet to output JSON and tag will parse it to make result an object :).
Because I can imagine people doing something like
{% capture result %} {% render 'snippet' %} {% end capture %} {% assign result = result | split: ";" %} {% if result[0] == "something" %} {{ result.[1] }}
{% else %}
{{ result.[2] }} {% endif %}
Subject | Author | Latest Post |
---|---|---|
Subject | Author | Posted |
---|---|---|
12-04-2019 12:55 PM | ||
11-23-2019 07:09 PM | ||
11-22-2019 03:09 AM | ||
11-15-2019 04:23 AM | ||
11-15-2019 03:03 AM |
User | Count |
---|---|
7 | |
7 | |
5 | |
5 | |
3 |