It worked thankyou
Topic summary
A user needed to display the announcement bar exclusively on the cart page in Shopify’s Dawn theme, rather than site-wide.
Initial Solutions Offered:
- One suggestion involved adding CSS code to
theme.liquidto hide the announcement bar on non-cart pages - Another user requested the store URL for further assistance
Problem Encountered:
The CSS approach caused the entire header section to disappear from the theme customizer, preventing the user from configuring the announcement bar.
Working Solution:
Wrap the content in sections/announcement-bar.liquid with a conditional statement:
{% if request.page_type == 'cart' %}
[announcement bar content]
{% endif %}
This Liquid template condition ensures the announcement bar renders only when the page type is ‘cart’.
Status: Resolved - the user confirmed the conditional approach worked successfully.