Analogous to #1349000: Provide option to automatically generate a color based on text, it would be great to have the option to have part of the hostname as environment indicator name.

I think a simple regular expression will serve most needs.

Comments

geek-merlin’s picture

FYI, here's my settings.php snippet that takes the first part of the url.

$uri = explode('/', $_SERVER['SCRIPT_NAME'] ? $_SERVER['SCRIPT_NAME'] : $_SERVER['SCRIPT_FILENAME']);
$server = implode('.', array_reverse(explode(':', rtrim($_SERVER['HTTP_HOST'], '.'))));
$parts = explode('.', $server);
$sitename = $parts[0];
$conf['environment_indicator_overwrite'] = TRUE;
$conf['environment_indicator_overwritten_name'] = $sitename;
$conf['environment_indicator_overwritten_color'] = '#'.substr(md5($sitename), 0, 6);

e0ipso’s picture

Status: Active » Closed (won't fix)

Version for D7 is unmaintained. I am sorry for the inconvenience.