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.
- Install your module as usual.
- Go to:
admin/config/development/environment-indicatorand add an environment by:
- Giving it a name.
- Setting a regular expression that will match the hostname: you can just paste in your hostname.
- Select a color.
- 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:
// 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;
$conf['environment_indicator_enabled'] = FALSE; $conf['environment_indicator_text'] = 'Staging'; $conf['environment_indicator_color'] = '#ff5555';