Hi,
Me and my team are recreating our theme from scratch using Shopify Skeleton Theme. I’m creating a header announcement bar and I am having issues with private blocks in section. I’m referring to this doc and this quick start but I still can’t get it to work.
I refer to the latest Horizon theme and they have a bunch of custom private blocks that work with their theme and works in the preview page.
Here is my code if anyone curious,
~/blocks/_announcement_content.liquid
{% schema %}
{
"name": "Announcement Content",
"tag":null,
"settings": [
{
"type": "inline_richtext",
"id": "announcement_text",
"label": "Announcment Text"
}
],
"presets": [
{
"name": "Announcement Content",
"settings": {
"announcement_text": ""
},
"blocks": []
}
]
}
{% endschema %}
~/sections/header-announcements.liquid
{% schema %}
{
"name": "Header Announcements",
"blocks": [
{
"type": "_announcement_content"
}
],
"enabled_on": {
"groups": ["header"]
},
"settings": [
{
"type": "range",
"id": "speed",
"label": "Rotating Speed",
"min": 2,
"max": 10,
"default": 5,
"unit": "sec"
},
{
"type": "header",
"content": "Appearance"
},
{
"type": "select",
"id": "section_width",
"label": "Section width",
"options": [
{
"value": "page-width",
"label": "Page Width"
},
{
"value": "full-width",
"label": "Screen Width"
}
],
"default": "full-width"
},
{
"type": "color",
"id": "background_colour",
"label": "Background Colour",
"default": "#000000"
},
{
"type": "color",
"id": "text_color",
"label": "Text Color",
"default": "#ffffff"
},
{
"type": "range",
"id": "border_size",
"label": "Border Size",
"min": 0,
"max": 5,
"step": 0.5,
"unit": "px",
"default": 0
},
{
"type": "header",
"content": "Content Padding"
},
{
"type": "range",
"id": "padding_block_start",
"label": "Content Top Padding",
"min": 0,
"max": 100,
"step": 1,
"unit": "px",
"default": 15
},
{
"type": "range",
"id": "padding_block_end",
"label": "Content Bottom Padding",
"min": 0,
"max": 100,
"step": 1,
"unit": "px",
"default": 15
}
],
"presets": [
{
"name": "Header Announcements",
"blocks": {
"announcement_1": {
"type": "_announcement_content",
"settings": {
"announcement_text": ""
}
}
},
"block_order": ["announcement_1"]
}
]
}
{% endschema %}
When I added it manually to the header-announcement section, when console logged, it return as type: \@theme, settings: {} in the the front-end, eventhough I poppulated the announcement-text with a string.
What am I missing from this code that It don’t work?
