Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
Hi guys,
i got a little question regarding the custom porto theme. im new to liquid and am testing myself to victory with a staggering 5% success rate 😉
Goal: I want to create 2 custom product templates which are simply copies of the standard product template.
i opened my theme backend and discovered the "following" after some testing:
The standard product template seems to include the 2 following files:
Templates
- product.liquid
Snippets
- product_view_default.liquid
So i created my new files:
Templates
- product.test.liquid
- product.test2.liquid
Snippets
- product_test_view_default.liquid
- product_test2_view_default.liquid
The contents are the same of product.liquid + product_view_default.liquid
So far so good
i can see the new templates in the product editor:
But how can i now "interlink" the product templates in the backend with the snippets? I dont know how to explain this better.
So if i choose the template product.test it will use the settings of the product_test_view_default.liquid snippet and not the
standard product_view_default.liquid.
I uploaded the 2 liquid files as txt. perhaps that helps figuring it out more easily
product_view_default.liquid.txt
I would be very happy if someone could help me out 🙂
Have a nice day and take care.
Phil
After digging through the internet i still find myself totaly lost 🙂
Im still in need for a helping hand 🙂
Did you figure this out? I have the exact same problem
Not yet.. sorry 😁
thanks for your reply, i figured it out. There's code in each of the files that links one to the other
Would you mind sharing that with me? 🙂
In the code found near the top of the custom product template file in the templates section you will find:
{%- include 'product_view_NAMEOFYOURSNIPPET' -%}
Change this to the name of your snippet file eg. if your template file is product.wide.liquid and the corresponding snippet file is product_view_wide.liquid
The code would be:
{%- include 'product_view_wide' -%}
Hey Community 👋 Did you know that March 15th is National Everything You Think Is W...
By JasonH Apr 1, 2025Discover how to increase the efficiency of commerce operations with Shopify Academy's l...
By Jacqui Mar 26, 2025Shopify and our financial partners regularly review and update verification requiremen...
By Jacqui Mar 14, 2025