The site banner displaying "SITE UNDER TEST" as viewed by administrators.
The settings page displaying options for the text, banner and text color.
The context settings page for site banner background and text color and text.
The site banner displaying "SITE UNDER TEST" as viewed by site visitors.
The site banner as seen when printing the viewed node.
The site banner as seen when printing the viewed node.
The site banner as seen when printing the viewed node.
An example of a Drupal 8 site with the Site Banner module activated.

Overview

Site banner allows you to display a banner at the top and bottom of a Drupal site. It is displayed at a fixed position so content is viewed within these top and bottom banners much like the administrator's toolbar. It also adds the banners to printed copies of Drupal site content.

It's a useful module for sites where sensitive information is held and want to make sure that your users are aware of the sensitivity of the content. The sensitivity of this content may vary between different nodes so the banner's text needs to change depending on the content being viewed. It would also help if you need that information displayed on the printed version of the site.

It also integrates with the context module, so you can configure contexts to alter the banner color and text depending on the context displayed. I found this is particularly useful if you combine it with the "Taxonomy" condition: so your banner text changes along with the content being displayed. For example, if you have sensitive information on a particular Drupal node that your visitors need to know is sensitive.

Features

  • Displays a "sticky" banner at the top and bottom of all Drupal pages.
  • Banner status (that is, if the banner is displayed or not) text, background and text colors can be changed by a user with appropriate priviliges.
  • Integrates with the context module so banner status, text and colors can changed with context changes.
  • Has a debug mode which allows a user with priviliges to modify the site banner from any Drupal page and shows any active contexts (if enabled).

Requirements

  • None. However, if you want to use the context integration you naturally need to install context and its dependency.

Issues

  • There are policies such as the Australian Government's Protective Security Policy Framework, specifically the supporting document "Protectively marking and handling sensitive and security classified information" which describe how sensitive content should be displayed. Whilst this module attempts to implement this requirement for a Drupal site, it has not been certified to conform to this or any policy document.
  • This module is most compatible with Internet Explorer 8 - where the top and bottom banners are rendered correctly on screen and in print. Firefox 22 renders these well, except you need to change the page margins in the print version. Chromium 25 renders the top and bottom banners on the first page, but it does obscure some text on the first page footer area. I haven't found a way to change the print settings in Chromium. The last two screenshots show the PDF print output using Mozilla Firefox 23 on Mac OSX Maverics. All testing was done on Mac OSX Mavericks, Windows XP or Windows 7.
  • The Drupal 8 version is very hacky, and just provides basic capabilities to early adopters. Please read the README.txt file on how to customize the module to your needs.

Credits

The CSS code used to create the header and footers was based on the article from Dynamic Drive CSS library:

http://www.dynamicdrive.com/style/layouts/category/C11

Similar modules

  • Development banner is a great module for developers and site builders to switch between test and production sites, but the site banner module specifically does text-only banners at the top and bottom of a page that appears on screen and in print. The site banner module has integration with the context module to alter banner text based on the node being viewed.
  • Environment indicator is another similar and equally great module for site builders and developers switching between test and production sites.

Potential future capabilities

  • Implemented in commit b887144. Enabled banner by content type, role, path (similar to block configuration) (from saitanay).
  • Implemented in commit d8617f8. Add a contextual link on the banner, linking to the config form. This link is shown only to those who have permission to configure the module (from saitanay).

Project information

Releases