Description
The Kowal_AnnouncementBar module adds an announcement bar in the store header (frontend) and an admin panel to manage announcement content, icon, and link. Rendering is global via the default.xml layout in the header.container, and rotation is handled by JS.
Who It’s For For e-commerce and marketing teams that want to manage short header messages without changing the theme code.
Features
Kowal\AnnouncementBar\Block\AnnouncementBar rendered in header.container on all pages via view/frontend/layout/default.xml and template view/frontend/templates/announcement_bar.phtml.kowal_announcementbar_announcement table; currently there is no status filter (the filter line is commented out), so all records are rendered.view/frontend/web/images/arrow.svg.view/frontend/web/js/announcement.js with fadeIn/fadeOut animation; the number of visible items depends on viewport width (>=1024: 4, >=768: 2, otherwise 1) and is updated on resize.background_color, font_color) is available in default/website/store view scope; values are fetched with ScopeInterface::SCOPE_STORE.kowal_announcementbar_announcement_listing, form kowal_announcementbar_announcement_form.kowal_announcementbar/announcement/upload) stores files under media/announcementbar/icons with dispersion and returns a public URL.kowal_announcementbar_announcement with columns announcement_id, icon, content, status, link.Installation
* = in production please use the --keep-generated option
Add the composer repository to the configuration:
composer config repositories.announcement.bar vcs https://github.com/kowalco/magento-2-announcement-bar
Add an access token for the private GitLab repository:
composer config --global --auth github-oauth.github.com <YOUR_TOKEN>
Install the module using Composer:
composer require kowal/module-announcementbar
Enable the module:
php bin/magento module:enable Kowal_AnnouncementBar
Apply database updates:
php bin/magento setup:upgrade
Flush the cache:
php bin/magento cache:flush
Configuration
Stores > Configuration > (tab: kowal) > Announcement Bar Settings > General Settings.kowal_announcementbar/general/background_color (hex, scope: default/website/store view).kowal_announcementbar/general/font_color (hex, scope: default/website/store view).etc/config.xml: #ffffff for background and #000000 for font color.Deployment and Operations
default.xml; in production mode you must deploy static content for view/frontend/web/css/source/_module.less and view/frontend/web/js/announcement.js to load.media/announcementbar/icons — ensure backup/retention for this directory.Deployment Checklist
kowal_announcementbar_announcement table is created after setup:upgrade.announcement.bar block renders in the header and JS/CSS load.media/announcementbar/icons.CI/CD and Environments
Rollback
php bin/magento module:disable Kowal_AnnouncementBar.media/announcementbar/icons consistent with DB records.Requirements / Notes
composer.json (require is empty) — compatibility must be confirmed in the target environment.etc/acl.xml does not define Kowal_AnnouncementBar::root, Kowal_AnnouncementBar::config, or Kowal_AnnouncementBar::top_level, although they are referenced in menu.xml, system.xml, and Controller/Adminhtml/Announcement.php. This may cause permission/menu visibility issues.etc/adminhtml/menu.xml, the parent is Kowal_Base::kowal_modules, and in system.xml the tab kowal is used — these elements are not defined in this module.status column (two entries with the same name in kowal_announcementbar_announcement_listing.xml).status field exists in DB and grid but is commented out in the edit form.Compatibility
FAQ
Kowal_AnnouncementBar::root, Kowal_AnnouncementBar::config, and Kowal_AnnouncementBar::top_level. This can block menu/config visibility.status filter on the frontend?
In Block/AnnouncementBar.php, the status filter is commented out, so all records are rendered.Installation section in README has unclosed code fences. In item.md, the code block was closed after step 6 to keep the rest of the document readable, while keeping the same layout and commands.kowal/module-announcementbar, while the module composer.json uses kowal/announcement-bar. This requires confirmation in the package repository.