Deploy non-emergency global banner
A site-wide banner can be activated to convey important information on GOV.UK which is not deemed emergency level information. Unlike the emergency banner, by default the global banner disappears after someone has seen it three times (controlled by a cookie).
The content of the site-wide banner is contained in
app/views/notifications/_global_bar.html.erb
in Static.
Activating the global banner
In app/views/notifications/_global_bar.html.erb
,
- Update the variables
title
,title_href
,link_text
andlink_href
with the relevant info where applicable, otherwise set tofalse
. - Update the
show_global_bar
variable totrue
- Optional: set the
always_visible
boolean totrue
if banner should not disappear after being seen enough times. - Deploy static
The usual Static deployment rules apply.
Add the target page to blocklist
The target page linked to from the banner will automatically hide the banner.
Add any other pages that don’t need to show the banner to the urlBlockList
in app/assets/javascripts/global-bar-init.js
.
Versioning the global banner
The number of times a user has viewed the banner is stored in a global_bar_seen
cookie.
Once the view count reaches 3, a user will not see the cookie again, even if the banner is
re-deployed. The only way a user will see the banner again is if:
- the
global_bar_seen
cookie expires, or - the global banner is versioned
To version the global banner, increase the BANNER_VERSION
in global-bar-init.js
by one.
Removing the global banner
In app/views/notifications/_global_bar.html.erb
:
- Update the
show_global_bar
variable tofalse
- Deploy static