Shopify themes, liquid, logos, and UX
Sorry for the simple question, but how/where do I set the Announcement bar för Dawn theme to off as default?
I'm doing some custom coding and everytime I upload the theme code I have to turn it off. Can't find where to turn it off by default (in code) /blush.
Solved! Go to the solution
This is an accepted solution.
Hi @Zeuligan,
Please go to header-group.json file and add code:
code:
"disabled": true,
Hi @Zeuligan ,
Here’s how you can turn off the Announcement Bar by default:
The schema for theme settings is located in the setting_schema.json file.
Search for the announcement bar section in the setting_schema.json file. It might look something like this:
{
"type": "checkbox",
"id": "show_announcement",
"label": "Show announcement bar",
"default": true
}
To turn it off by default, change the "default": true to "default" : false :
{
"type": "checkbox",
"id": "show_announcement",
"label": "Show announcement bar",
"default": false
}
If you want to ensure the Announcement Bar is permanently disabled, you can directly edit the header.liquid (or relevant file) where the Announcement Bar is included:
Go to the Sections folder in the theme editor.
Open the file that renders the Announcement Bar, usually named announcement-bar.liquid or part of header.liquid .
Surround the bar's logic with a condition that prevents it from rendering:
{% if false %}
{% render 'announcement-bar' %}
{% endif %}
This ensures the Announcement Bar is never displayed, regardless of theme settings.
Got it! If you found my suggestions helpful, please consider liking or marking it as a solution.
Your feedback is appreciated! If you have any more questions or need further assistance, just let me know.
Thanks & Regards
Akshay Bhatt
Dawn 15.2.0, there is no such setting or code, otherwise I would have found it by searching in all the code files unfortunately.
This is an accepted solution.
Hi @Zeuligan,
Please go to header-group.json file and add code:
code:
"disabled": true,
Thank you so much. Tried all places BUT that place with disabled, sometimes I wonder... 🙂
Have a great day
Hi @Zeuligan,
This will keep the section visible in Customize but hidden. This would be better than removing the code completely. 😊
Dropshipping, a high-growth, $226 billion-dollar industry, remains a highly dynamic bus...
By JasonH Nov 27, 2024Hey Community! It’s time to share some appreciation and celebrate what we have accomplis...
By JasonH Nov 14, 2024In today’s interview, we sat down with @BSS-Commerce to discuss practical strategies f...
By JasonH Nov 13, 2024