1
votes

I'm trying to customize a Shopify theme and I want to include a template into another template, but this seems to work for snippets only.

Detailed: I want to add the login / register forms into a dropdown menu in the header which appears onlick. So I added to my theme.liquid file the following code:

{% include 'customers/login' %}

But this returns the following error:

"Liquid error: Could not find asset snippets/customers/login.liquid"

This means that include can be used only for snippets? No template can be included / called into another? Or am I missing something?

Any way around this or a direct command for templates / pages?

2

2 Answers

2
votes

No Shopify template can be included / called into another template. You should rely on snippets.

1
votes

Shopify {% include '' %} works only with snippets, hence why your returned error by defaults states that it looked into snippets folder and could not found what you have included as in:

"Liquid error: Could not find asset snippets/customers/login.liquid"

That pretty much says the liquid looked for the login.liquid file inside the customers folders in snippets, but could not find it!

In this case, you would want to go to templates ==> create new templates and duplicate the file you want to make changes on.