Environment Label
The Environment Label plugin adds a nice coloured banner to your CraftCMS control panel so you'll never forget what environment you're using.
The colors and text of the environment label are configurable via the plugin config file.
Configuration
By default, the environment label will display the value of Craft's CRAFT_ENVIRONMENT
constant, which is usually set to the current hostname unless you override it.
(In other words, out of the box, you get a red banner with white text that alerts you to the current hostname.)
You can use a plugin config file to tweak the appearance and text of the environment label for each installation.
Simply add an environment-label.php
file to your config
directory.
<?php
return [
'showLabel' => true,
'labelText' => CRAFT_ENVIRONMENT,
'prefixText' => null,
'suffixText' => null,
'labelColor' => '#cc5643',
'textColor' => '#ffffff',
'targetSelector' => '#global-header:before',
];
For added flexibility, the full text of the label will be rendered as a Twig template, so you can also include template variables if you want:
<?php
return [
'suffixText' => " // {{ currentUser }}",
);
- Installation Instructions
To install this plugin, copy the command above to your terminal.
- Active Installs
- 4,969
- License
- Craft
- Last release
- April 26, 2023
- Activity (30 days)
- 0Closed Issues0Open Issues0Merged PRs0Open PRs