-
Notifications
You must be signed in to change notification settings - Fork 284
-
Notifications
You must be signed in to change notification settings - Fork 284
Usage of include vs. render #168
Comments
Any verdict on this? |
This starter theme hasn't been updated to reflect this change yet. As far as I know, the |
Blocking issue is Which makes it a good reason ,for now, that existing themes continue to use |
Hi All, |
Use |
@prayagbs If your trying to nest a snippet within itself to reuse code, such as a menu builder or grid system or filter hierarchy , then keep in mind when using render that any nested render's cannot permanently change variables of the outer render snippets. |
@PaulNewton Thank you |
At this point, we should all use |
yes replace with include to render |
Thanks @ersanjay1995 ! |
I'm finding |
Here's my solution, if it's useful to anyone. Originally, in my section file, I had the following (inside a
The
Then, within the included liquid file, you could access the |
@Ross-Angus you could just do What you describe is true and the purpose of it. Nothing can leak into and out of a render block. You can pass in variables though as you have done |
According to the Shopify docs, we should be avoiding
include
(https://help.shopify.com/en/themes/liquid/tags/deprecated-tags#include) and instead usingrender
(https://help.shopify.com/en/themes/liquid/tags/theme-tags#render).As a reference theme this is great, but it seems to contradict the official docs.
From the docs on
include
:Is this theme going to be updated to reflect that? Or is there a reason it is still using
include
?The text was updated successfully, but these errors were encountered: