Announcement Bar for Bricks
A Bricks element for a bar of offers, news or notices. It can rotate several messages, count down to a date, follow a schedule, and be dismissed so it stays dismissed without a flash on the next page.
Version: 0.2.0 Demo: Announcement Bar demo
Adding it
Add the Announcement Bar element from the General group, usually at the top of your header or the page’s first section.
Messages
- Each message has its own text, optional icon, link text, link address, an option to open in a new tab, and optional from and until dates, so you can line up a sequence of messages in advance.
- Text and link accept dynamic data.
- Link style: underlined, with an arrow, a small button, or plain. Make the whole message the link turns the entire line into one target.
Several messages
- Change every N seconds, with a fade, a slide or no effect.
- Previous and next arrows, pause on hover or focus, and an option to start on a random message.
Countdown
Pick a date and time and the bar shows a live countdown after the message, with your own lead-in text. At zero it can hide itself or show text such as Offer ended. The seconds can be switched off.
When and where
- Show from and until for the whole bar, in the WordPress time zone. Outside those dates the bar is not put in the page at all.
- Show to everyone, visitors who are not logged in, or logged-in users.
- Show on all screens, wide screens only or narrow screens only, with the width where narrow ends.
- Position: scrolls away, stays at the top (with a gap for a sticky header), or stays at the bottom of the screen.
- When it appears: no effect, slide in or fade in, with an optional wait of a few seconds.
Dismissing
- A close button on the right, left or after the message, as a cross or with your own words such as Got it.
- Stays dismissed for a number of days, or until the browser closes. If you change the messages, the bar comes back for everyone.
- Shared dismiss ID: bars with the same ID are dismissed together, wherever they are. Change the ID to bring a dismissed bar back for everyone.
- Add the class
abfb-resetto any link to give visitors a Show dismissed bars again link.
Style
Dark, green, light, notice or urgent presets, then your own background (including a gradient or image), text, link and button colours, typography, padding, border, a maximum content width, and alignment left, centre or right.
Caching
Dates, audience and the countdown are worked out when the page is built, so with a page cache the bar follows the cache’s refresh. The countdown itself ticks in the browser.