Shopify themes, liquid, logos, and UX
Hi,
I would like to know if it's possible to insert a custom field for templates on product pages, where we could insert a product tag and the template would be shown or hidden, depending if the product has the same tag or not.
Here is the image, and on the left we would need a field where we could insert the product tag.
Thank you
Solved! Go to the solution
This is an accepted solution.
If you want to add a custom field to an existing section, then the answer is yes you can.
At the bottom of the source code for that particular section, you will see a big {% schema %} section. If you add new fields in here, they will appear in that left hand window, and you can then refer to those fields in the code with {{ section.???? }} to do certain things. In your case, it sounds like you want to check certain tag values, and show them or not.
You'll need a bit of coding / liquid experience, but assuming you do, its shouldn't be too bad.
This reference explains how to add fields to the schema
https://shopify.dev/themes/architecture/sections/section-schema
By the way, unless you particularly need your Shopify admin to be multi language, you don't need to worry about all the language translations.
"label": "My Custom Field"
Will do, rather than the dozen or so locales.
Hope that helps,
Kevin.
This is an accepted solution.
If you want to add a custom field to an existing section, then the answer is yes you can.
At the bottom of the source code for that particular section, you will see a big {% schema %} section. If you add new fields in here, they will appear in that left hand window, and you can then refer to those fields in the code with {{ section.???? }} to do certain things. In your case, it sounds like you want to check certain tag values, and show them or not.
You'll need a bit of coding / liquid experience, but assuming you do, its shouldn't be too bad.
This reference explains how to add fields to the schema
https://shopify.dev/themes/architecture/sections/section-schema
By the way, unless you particularly need your Shopify admin to be multi language, you don't need to worry about all the language translations.
"label": "My Custom Field"
Will do, rather than the dozen or so locales.
Hope that helps,
Kevin.
Portrait of Stephen positioned next to an image of planet Earth, with the Stephen's World ...
By JasonH Mar 18, 2024Digital marketers and app developers have tracked activity in apps and websites for yea...
By Ollie Mar 13, 2024February was an exciting month with Shopify Editions, informative webinars, and more! F...
By JasonH Mar 7, 2024