Environment Label
Last modified: February 24, 2026
Extension name
t2/t2/environment-label
- Adds a banner to the top left of the screen with info about the current environment type.
- Adds the same information to the admin bar in format "Environment: {current-environment}"
- Exposes a JavaScript constant
dekodeLabelEnvironmentcontaining the environment type.
JavaScript Constant
The extension outputs a global JavaScript constant early in the page head:
const dekodeLabelEnvironment = "local"; // or "production", "staging", "development"
This allows you to implement environment-specific client-side logic. For example:
// Bypass cookie consent on local environments
if (dekodeLabelEnvironment === 'local') {
// Enable video embeds without consent
initializeVideos();
}
Filters:
dekode_label_environment_enabled: Can be used to turn the filters in this plugin off (bool - default true).dekode_label_environment_banner_enabled: Can be used to show the banner also in production, e.g. during development of new site (bool - default true if not in production).