Last updated March 20, 2014. Created by e0ipso on May 12, 2013.
Edited by Jon Pugh, cedewey, Alan D., ksepb. Log in to edit this page.

Note that the Environment Indicator (envindicator) project was a complete rewrite of Environmental Indicator. This project has been incorporated back into Environment Indicator (environment_indicator) as part of the 7.x-2.x branch.

Key differences with the 7.x-1.x release:

  • You can configure all your indicators from one place.
  • You can position your indicator to not to interfere with your design.
  • You can control permissions per environment. This way you can show the indicator for anonymous users in all the environments except for production.
  • You can export your configurations to code and include them in GIT.
  • It can be used on dynamically generated environments.
  • Your site builders won't need to access your settings.php.
  • It's integrated with the features module.
  • It's integrated with the Toolbar module.
  • Integration with Admin menu module.
  • You have an environment switcher to open the current page in a different environment.
  • You have a favicon indicator that will help you notice which tab is the production environment without ever opening the tab.

There is also a super cool thing called Environment Indicator Variables, which will allow you to override the values of variables per environment. Find out more about it here.

Usage

Watch the video. Video in Spanish.

Video

  1. Install your module as usual.
  2. Go to: admin/config/development/environment-indicator and add an environment by:
    1. Giving it a name.
    2. Setting a regular expression that will match the hostname: you can just paste in your hostname.
    3. Select a color.
    4. Select the position.

OR The settings for the Environment Indicator, such as the text to display and the color can be overridden for each of your specific environments using the configuration UI or in the site's settings.php file. You can also export this configuration to code, this allows you to customize the indicator for each environment without needing to make any changes in the database. This means that the Environment Indicator will always display correctly when moving your site from development to staging to production. If you choose to detect your environment using settings.php, then all configuration variables can be overridden in settings.php, but the most common three are:

VERSION 2.x

<?php
// Whether the Environment Indicator should use the settings.php variables for the indicator. On your production environment, you should probably set this to FALSE.
$conf['environment_indicator_overwrite'] = TRUE;
// The text that will be displayed on the indicator.
$conf['environment_indicator_overwritten_name'] = 'Staging';
// Valid css colors for the text and background of the admin toolbar and environment indicator.
$conf['environment_indicator_overwritten_color'] = '#ff5555';
$conf['environment_indicator_overwritten_text_color'] = '#ffffff';
// Where your indicator may appear. Allowed values are "top" and "bottom".
$conf['environment_indicator_overwritten_position'] = 'top';
// A boolean value indicating whether the Environment Indicator should be visible at all times, fixed at the top/bottom of the screen.
$conf['environment_indicator_overwritten_fixed'] = FALSE;
?>

VERSION 1.x

<?php
$conf
['environment_indicator_enabled'] = FALSE;
$conf['environment_indicator_text'] = 'Staging';
$conf['environment_indicator_color'] = '#ff5555';
?>

Usage
Usage

Looking for support? Visit the Drupal.org forums, or join #drupal-support in IRC.