Liquid, JavaScript, themes, sales channels
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' -%}
User | RANK |
---|---|
37 | |
28 | |
13 | |
13 | |
9 |
On our Shopify Expert Marketplace, you can find many trusted third party developers and fr...
By Arno Nov 27, 2023You've downloaded the Search & Discovery app from the Shopify App store, and as you're ...
By Skye Nov 8, 2023The year-end shopping season is just around the corner. Is a flash sale on your radar? Are...
By Jasonh Nov 6, 2023