Created
August 8, 2019 13:31
-
-
Save loughlincodes/2238988f2ce50eeee8fe9a21abc40556 to your computer and use it in GitHub Desktop.
How to pass vars to snippets in Shopify
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Method 1: Declare variables right above the snippet: | |
{% assign snippet_variable = ‘this is it’ %} | |
{% assign snippet_variable_two = ‘this is also it’ %} | |
{% include ‘snippet’ %} | |
Method 2: Include variable into include command: | |
{% include ‘snippet’, snippet_variable: ‘this is it’, snippet_variable_two: ‘this is also it’ %} | |
There was a filthy rumour being spread at Unite 2019 that snippets were scheduled to be removed. | |
I have my hat ready and waiting to be eaten... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment