Problem/Motivation

As stated, I am looking into options on how I can still show an environment indicator even when a user is not logged in or when a user is logged in but don't have access to toolbar.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

robpowell created an issue. See original summary.

robpowell’s picture

StatusFileSize
new51.52 KB
new64.37 KB
new44.87 KB

I've gone ahead and created a submodule, environment_indicator_block. If the maintainers rather this as a separate module please let me know.

One outstanding question, I am managing my indicator values through hardcoding them in the settings file:

# Site environment
$config['environment_indicator.indicator']['name'] = 'LOCAL';
$config['environment_indicator.indicator']['bg_color'] = '#8A1350';
$config['environment_indicator.indicator']['fg_color'] = '#FFFFFF';

For my setup, it doesn't seem like I need to add any cacheable metadata to the block because it will require a cache rebuild to get the overrides, right? What would be a good way to future proof it a bit?

Here are some screenshots of the block in action

admin ui with colored toolbar
admin ui block placement
bartik anonymous user with block placement

robpowell’s picture

Status: Active » Needs review
colan’s picture

Status: Needs review » Closed (outdated)

There are permissions for each environment now, and you can turn off the toolbar feature (so it show up by itself).