manuel introduces the Announcement Bar theme component, a dismissable bar for displaying announcements. Key features include customizable placement, localized text, and CSS styling via BEM classes. The component requires Discourse v3.2.0.beta3 or higher due to .gjs file usage Arkshine. manuel declined requests to add group-based visibility settings, suggesting CSS targeting via the Discourse groups css classes helper component instead manuel.
A significant discussion arose regarding dismissal behavior. Aaron_Walsh and others reported that dismissing the bar seemed to hide it for other users or persist across sessions unexpectedly. Heliosurge clarified that dismissal should be user-specific. Investigation revealed the issue stemmed from the cookie implementation, which was tied to browser history/cache rather than just the user session manuel, Heliosurge. Clearing cookies alone did not always restore the bar, leading to confusion about scope manuel, Aaron_Walsh.
Additionally, dementad reported a display issue where the bar appeared below the header on the live site despite preview settings, unrelated to the FKB Pro theme.
In response, manuel released updates: replacing cookies with localStorage keyed by bar text (ensuring re-appearance on text updates), consolidating responsive styles, and moving strings to locales for easier translation.
Thanks for the suggestion @kinetiksoft! I like to keep shared components without group features though . The reason is that in my experience the actual use cases are often more specific than just selecting a group. You might need to distinguish anonymous visitors as well. Or display different content to different groups. And then it adds complexity already.
I usually fork components or just implement different layout options with CSS. So I’m afraid this would be my recommendation as well.
Sorry for the confusion @martyn_thomas and thanks for explaining the reason @Arkshine! I’ve updated the about file to state "minimum_discourse_version": "3.2.0.beta3".
I could be mistaken, but I believe when someone dismisses the announcement (which should be an option for the admin to remove), it removes it for everyone else separately in desktop view or mobile view.
I don’t exactly understand what you’re referring to. Could you state again what you did on the admin backend and then what you saw as outcome for users? And for which users?
I have this on my forum, but it disappears when I haven’t crossed it off as you have an option to show it or not, as an end user.
I’ve disabled and enabled it again to see if it was an issue, but I believe when someone dismisses the theme components it removes it for everyone else. First, I noticed it on my desktop view, then next on mobile view.
Now if you dismissed the current banner and disable and re enabled the component. It will not reappear unless either changed or iirc you might need to clear cookies.
dismiss the announcement bar, either as a user or anonymous visitor
log out or switch to a different user account on the same browser
the bar will not show on the same browser
So I assume this is a cache issue. Apparently the way the cookie is implemented is not sensitive to the user account but to the browser history. I copied the cookie code from another component and I’m not very knowledgeable about how cookies work in detail. Happy to change the code if it’s actually possible and someone has the code. Else I’m not that concerned about it. What I see is that it only affects the same browser, and the bar is not dismissed for other users on their respective session.
I can confirm. Loaded bar. Dismissed with my admin account.
Logged in an anon browser with different user.
Not logged in Bar shows. Logged in test user bar shows. Disniss bar and log out and back in no bar. Close incognito chrome browser and open new one. Announce bar is back.
So definitely a cookie/browser cache related issue.