I’m trying to add a color picker to a change the color of a heading but I can’t workout how to add a relation between heading and color picker.
this currently doesn’t save as its not valid Json, but this is what I’ve added to the sections > hero.liquid file
{
"type": "text",
"id": "title",
"label": "Heading",
"default": "Image with text overlay"
"settings": [
{
"type": "color",
"id": "color_title",
"label": "Heading color",
"default": "#FFFFFF"
}
]
},
If i include the color picker external to the settings it shows but has no relation to any elements
2
Answers
You don’t create the relationship in the schema but in the liquid itself.
The correct syntax is:
Then you can do something like:
<h2 style="color: {{settings.color_title}}">{{ settings.title }}</h2>
Then outside the schema tag, to output the color to shopify:
user_color
being theid
of the color picker.This syntax outputs
Kols might be the king
text in black, which is the default color in the schema settings.