Managing site-wide announcements
Accounts with the proper permission can post a prominent announcement on the site, consisting of an icon, headline, message and web link. The announcement can be set to display on the homepage or on all pages.
Contents
Manage announcement permissions
Any user with the “Manage site announcement” permission can configure and display the site announcement. Two additional permissions are provided for managing the site announcement components – the available icons and color schemes. These different permissions allow a site to give certain users the ability to post the announcement, while other, more privileged users can manage the configuration capabilities. As always, a good practice is to create a user “role” that bundles permissions appropriate to a given set of users.
Permission |
Capability |
|---|---|
Manage site announcement |
Create and post site announcements |
Manage announcement color schemes |
Add, edit, and delete the available announcement icons |
Manage announcement icons |
Add, edit, and delete the available announcement color schemes |
Post a site announcement
Navigate to Configuration > Site Announcement (
/admin/config/site-announcement).The “Announcement status” field is self-explanatory, determining whether the announcement is active and where it should display.
The title, message, and call to action are all optional fields.
By default, 3 symbol icons are available: bullhorn, a beacon, and an alert warning. Individual sites may supplement these with their own (see below).
By default, 4 color schemes are available, as shown in the configuration form. Individual sites may supplement these with their own (see below).
Pressing “Save configuration” will immediately set the site announcement per your changes (active/inactive, text & styling choices).
Note
It is only possible to have one announcement configured at a time.
It may be useful to configure an announcement ahead of time and leave the “Announcement status” set to “Inactive” until it is ready to display.
Remove an active site announcement
Navigate to Configuration > Site Announcement (
/admin/config/site-announcement).Set the “Announcement status” field to “Inactive”.
Press “Save configuration”.
Add additional icons
Users with the “Manage announcement icons” permission may add additional symbols, available in the site announcement configuration.
Navigate to Configuration > Site Announcement > Icons (
admin/config/site-announcement/icons).Click “Add announcement icon”.
Input a label to differentiate this icon from others.
Use the ‘Browse’ button to upload an SVG of your choice, or if you do not plan to use your own SVG image, you can download a broad variety of SVG icons for free.
Add additional color schemes
Users with the “Manage announcement color schemes” permission may add additional background/foreground color schemes.
Important
It is your responsibility to ensure that color schemes you add have sufficient color contrast between the background and foreground. See https://webaim.org/blog/wcag-2-0-and-link-colors/
Navigate to Configuration > Site Announcement > Color Schemes (
admin/config/site-announcement/color-scheme).Click “Add announcement color scheme”.
Add a descriptor to differentiate this scheme from others.
Set the background and text colors using HTML hex codes. Read about WCAG 2.0 accessibility standards for link colors and use WebAim’s Contrast Checker .
Integrate with different theme
The site announcement is designed to render in a Drupal theme region that has the machine name site_announcement. In Forty Acres, this is positioned at the bottom of the header template in the filesystem at web/themes/contrib/forty_acres/templates/includes/header.html.twig. To make the site announcement work in a theme not based on Forty Acres, the theme requires a region explicitly called site_announcement, rendered in a page-level template similar to Forty Acres. There is no need to create a custom template for the new region since it uses the fallback region.html.twig template.