Plugin screenshot thumbnail 1/1

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,990
Version
4.0.2
License
Craft
Compatibility
Craft 3, Craft 4
Last release
July 28, 2022
Activity (30 days)
0
Closed Issues
1
Open Issues
0
Merged PRs
0
Open PRs