include
Tag
Inserts and executes a partial file from the partials/
folder of the theme.
Description
Inserts and executes a partial file from the partials
folder of the theme.
Note that the .liquid
extension is omitted when making this call.
The code within an included partial will have access to the variables available to its parent template.
You can also choose to set additional variables available to the included partial when calling
the include
tag:
Parameters
-
with
-
As a shortcut, this parameters allows you to assign a value to a variable inside the included partial that shares the same name as the template.
In this example, the template at
partials/color.liquid
will have a variable namedcolor
available with the valuered
: