slate icon indicating copy to clipboard operation
slate copied to clipboard

usage not allowed in this context

Open drinkmorewaters opened this issue 5 years ago • 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 %}

drinkmorewaters avatar Nov 18 '19 03:11 drinkmorewaters

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.

floatingdino avatar Nov 25 '19 01:11 floatingdino

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.

curiouscrusher avatar Jan 09 '20 20:01 curiouscrusher