AI answers drawn only from these docs, with links to the pages used.

Liquid Tags: Include

Last updated on October 15, 2026

The tag adds a partial to a page and runs it in the page's scope. For a self-contained partial that produces HTML, use render instead: . A rendered partial sees only the variables you pass to it, plus global objects such as context.

The simplest example of looks like this:

app/views/pages/include.liquid

app/views/partials/mypartial.liquid

app/views/partials/mypartial2.liquid

After expanding , rendered content becomes:

You can include the exact partial multiple times in multiple places for code reuse.

This article details the following topics:

  • Passing parameters to a partial
  • Local variable using with
  • Iterating over a collection using for
  • Using and exporting private variables

Passing Parameters to a Partial

You can pass any number of parameters to a partial.

app/views/pages/index.liquid

app/views/partials/car.liquid

Tip

Put a space between the parameter name and its value, for example .

Important

You cannot name a parameter the same as the partial (in this case ).

Local Variable using 'with'

Liquid has some issues when using a variable named the same as the partial. For example, if you have this partial:

You won't be able to set the variable by passing it during the include:

but you will be able to set this variable by using :

This will create the variable called with hash inside of it.

The properties of hash are accessible using the syntax, for example:

Iterating over a Collection Using 'for'

This will iterate over the collection and render the partial for each item. Each iteration will have the variable populated with the current item.

A partial that looks like this:

app/views/partials/product.liquid

Will render (whitespace adjusted for readability):

Using and Exporting Private Variables

In Insites, variables you create in a partial stay in that partial.

In Insites, when you define a variable in a partial, it is not visible by default on a page including that partial.

It works from top to bottom, though: If you define a variable on a page and then include it in a partial, it will be accessible in the partial.

That means that given this partial:

app/views/partials/variable.liquid

And this page using it:

app/views/pages/include.liquid

Will not return 'Honda' on the page. The variable can be accessed only inside the partial.

To use a variable that has been defined inside a partial, you need to use the tag and outside of it.

app/views/partials/export.liquid

app/views/pages/include.liquid

This should render the stringified hash stored inside the variable in the first line and nested key in the second:

Have a suggestion for this page?

Didn't quite find what you are looking for or have feedback on how we can make the content better then we would love to hear from you. Please provide us feedback and we will get back to you shortly.