2017 © Pedro Peláez
 

craft-plugin environment-label

...so you don't forget where you are.

image

topshelfcraft/environment-label

...so you don't forget where you are.

  • Tuesday, June 5, 2018
  • by TopShelfCraft
  • Repository
  • 3 Watchers
  • 7 Stars
  • 1,730 Installations
  • PHP
  • 3 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 6 Versions
  • 122 % Grown

The README.md

Environment Label

...so you don't forget where you are., (*1)

A Top Shelf Craft creation
in collaboration with Kind, (*2)

TL;DR.

The Environment Label plugin adds a nice coloured banner to your CraftCMS control panel so you'll never forget what environment you're using., (*3)

The colors and text of the environment label are configurable via the plugin config file., (*4)

Screenshot, (*5)


Installation

Visit the Plugin Store in your Craft control panel, search for Environment Label, and click to Install the plugin., (*6)

You can also install the package via Composer., (*7)

composer require topshelfcraft/environment-label

Then, navigate to the Plugins section of the control panel, find Environment Label in the list, and click the Install button., (*8)

Configuration

You can use a plugin config file to tweak the appearance and text of the environment label for each installation., (*9)

Simply add an environment-label.php file to your config directory., (*10)

<?php

return [
    'showLabel' => true,
    'labelText' => "My Label Text",
    'labelColor' => '#cc5643',
    'textColor' => '#ffffff',
    'targetSelector' => '#global-header:before',
];

The text of the label will be rendered as a Twig template, so you can also include template variables to make the text dynamic:, (*11)

<?php

return [
    'labelText' => "Editing as: {{ currentUser }}",
);

Settings in the Control Panel

You can also make basic changes to the text and appearance of the environment label via the plugin Settings page., (*12)

Settings, (*13)

, (*14)

This is provided as a convenience for easily testing out the plugin, but for full customizability, you should use a plugin config file as described above., (*15)

(Settings specified in the plugin config file will override any changes made via the Settings page in the control panel.), (*16)

Twig template globals

Environment Label makes itself available via a Twig template global variable, so you can create your own environment label rendering in your public templates:, (*17)

{{ environmentLabel.renderedText }}
{{ environmentLabel.labelColor }}
{{ environmentLabel.textColor }}

What are the system requirements?

Craft 5.0+ and PHP 8.2+, (*18)

I've found a bug.

No you haven't., (*19)

Yes, I believe I have.

Well, alright. Please open a GitHub Issue, and if you're feeling ambitious, submit a PR to the 5.x.dev branch., (*20)


Contributors:

The Versions

05/06 2018

dev-master

9999999-dev

...so you don't forget where you are.

  Sources   Download

MIT

The Requires

 

cms craftcms craft-plugin craft environment label

05/06 2018

dev-3.x.dev

dev-3.x.dev

...so you don't forget where you are.

  Sources   Download

MIT

The Requires

 

cms craftcms craft-plugin craft environment label

05/06 2018

3.1.4

3.1.4.0

...so you don't forget where you are.

  Sources   Download

MIT

The Requires

 

cms craftcms craft-plugin craft environment label

22/03 2018

3.1.3

3.1.3.0

...so you don't forget where you are.

  Sources   Download

MIT

The Requires

 

cms craftcms craft-plugin craft environment label

08/03 2018

3.1.2

3.1.2.0

...so you don't forget where you are.

  Sources   Download

MIT

The Requires

 

cms craftcms craft-plugin craft environment label

31/12 2017

3.1.1

3.1.1.0

...so you don't forget where you are.

  Sources   Download

MIT

The Requires

 

cms craftcms craft-plugin craft environment label