Shopify/slate

usage not allowed in this context

drinkmorewaters opened this issue · 2 comments

https://community.shopify.com/c/Technical-Q-A/Include-usage-not-allowed-in-this-context-in-product-page-Debut/td-p/598022/page/2

https://help.shopify.com/en/themes/liquid/tags/theme-tags#render

The include tag breaking change might catch some people. Shopify has changed from 'include' to 'render' for sections but slate does or doesn't support it?

Either way, broke our theme. If you get the error do below.

Don't use the latest

{% render 'section-name %}

use the soon to be deprecated

{% include 'section-name %}

You can upload liquid files with the render tag using Slate, but if you use render the snippet can't use include anywhere down the chain.

I've been using {% render 'snippetName' %} within Slate for quite some time now and haven't had any issues. I think you'll find the fundamental change between how {% include %} and {% render %} work is more than likely the root cause of your issue. When you include a snippet it's aware of your template context, but when you render a snippet it's only aware of any data you pass to it or that is included in the snippet already.