Favicon
The favicon of the frontend or backend context will be modified regarding the environment and the associated configuration.

Favicon Example
Inhaltsverzeichnis
- local
- depth
-
2
Frontend
For the frontend, the original favicon will either be fetched from the typoscript configuration
page.
(see typoscript reference)
or can be handled by your own fluid template via the Favicon
:
<html xmlns:env="http://typo3.org/ns/KonradMichalik/Typo3EnvironmentIndicator/ViewHelpers"
data-namespace-typo3-fluid="true">
{f:uri.resource(path:'EXT:your_extension/Resources/Public/Favicon/favicon.png') -> env:favicon()}
{env:favicon(favicon:'EXT:your_extension/Resources/Public/Favicon/favicon.png')}
Backend
For the backend, the favicon will be fetched by the extension configuration of
$GLOBALS
.

Favicon Examples
Modifiers
The favicon modification configuration can be found in
$GLOBALS
.
Add a configured favicon modifier to the desired environment (e.g. Testing
) in your ext_
:
use KonradMichalik\Typo3EnvironmentIndicator\Configuration\Handler;
use KonradMichalik\Typo3EnvironmentIndicator\Configuration\Indicator;
use KonradMichalik\Typo3EnvironmentIndicator\Configuration\Trigger;
use KonradMichalik\Typo3EnvironmentIndicator\Image;
Configuration\Handler::addIndicator(
triggers: [
new Trigger\ApplicationContext('Testing')
],
indicators: [
new Indicator\Favicon([
new Image\Modifier\TextModifier([
'text' => 'TEST',
'color' => '#f39c12',
'stroke' => [
'color' => '#ffffff',
'width' => 3,
],
])
])
]
);

The modifiers will be executed one after the other. You can combine them if you want.
Note
If you want to specify the frontend or backend favicon separately, you can add the another parameter for the request context favicon
or favicon
to the config
method.
The following modifier classes are available:
TextModifier
This is the default modifier if no own configuration is set.
use KonradMichalik\Typo3EnvironmentIndicator\Configuration\Handler;
use KonradMichalik\Typo3EnvironmentIndicator\Configuration\Indicator;
use KonradMichalik\Typo3EnvironmentIndicator\Configuration\Trigger;
use KonradMichalik\Typo3EnvironmentIndicator\Image;
Configuration\Handler::addIndicator(
triggers: [
new Trigger\ApplicationContext('Development')
],
indicators: [
new Indicator\Favicon([
new Image\Modifier\TextModifier([
'text' => 'DEV',
'color' => '#bd593a',
'stroke' => [
'color' => '#ffffff',
'width' => 3,
],
])
])
]
);

Additional optional configuration keys:
font
(string): The font file path for the text. Default isEXT:
.typo3_ environment_ indicator/ Resources/ Public/ Fonts/ Open Sans- Bold. ttf position
(string): The position of the text. Default isbottom
. Possible values arebottom
,top
.
TriangleModifier
Adds a triangle indicator to the favicon.
use KonradMichalik\Typo3EnvironmentIndicator\Configuration\Handler;
use KonradMichalik\Typo3EnvironmentIndicator\Configuration\Indicator;
use KonradMichalik\Typo3EnvironmentIndicator\Configuration\Trigger;
use KonradMichalik\Typo3EnvironmentIndicator\Image;
Configuration\Handler::addIndicator(
triggers: [
new Trigger\ApplicationContext('Development')
],
indicators: [
new Indicator\Favicon([
new Image\Modifier\TriangleModifier([
'color' => '#bd593a',
])
])
]
);

Additional optional configuration keys:
size
(float): The percentage size of the triangle. Default is0.
.7 position
(string): The position of the triangle. Default isbottom right
. Possible values arebottom left
,bottom right
,top left
,top right
.
CircleModifier
Adds a circle indicator to the favicon.
use KonradMichalik\Typo3EnvironmentIndicator\Configuration\Handler;
use KonradMichalik\Typo3EnvironmentIndicator\Configuration\Indicator;
use KonradMichalik\Typo3EnvironmentIndicator\Configuration\Trigger;
use KonradMichalik\Typo3EnvironmentIndicator\Image;
Configuration\Handler::addIndicator(
triggers: [
new Trigger\ApplicationContext('Development')
],
indicators: [
new Indicator\Favicon([
new Image\Modifier\CircleModifier([
'color' => '#bd593a',
])
])
]
);

Additional optional configuration keys:
size
(float): The percentage size of the circle. Default is0.
.4 position
(string): The position of the circle. Default isbottom right
. Possible values arebottom left
,bottom right
,top left
,top right
.padding
(float): The percentage padding of the circle. Default is0.
.1
FrameModifier
Adds a frame around the favicon.
use KonradMichalik\Typo3EnvironmentIndicator\Configuration\Handler;
use KonradMichalik\Typo3EnvironmentIndicator\Configuration\Indicator;
use KonradMichalik\Typo3EnvironmentIndicator\Configuration\Trigger;
use KonradMichalik\Typo3EnvironmentIndicator\Image;
Configuration\Handler::addIndicator(
triggers: [
new Trigger\ApplicationContext('Development')
],
indicators: [
new Indicator\Favicon([
new Image\Modifier\FrameModifier([
'color' => '#bd593a',
])
])
]
);

Additional optional configuration keys:
border
(float): The border size of the frame. Default isSize 5
.
ReplaceModifier
Replace the original favicon with a custom one regarding the environment.
use KonradMichalik\Typo3EnvironmentIndicator\Configuration\Handler;
use KonradMichalik\Typo3EnvironmentIndicator\Configuration\Indicator;
use KonradMichalik\Typo3EnvironmentIndicator\Configuration\Trigger;
use KonradMichalik\Typo3EnvironmentIndicator\Image;
Configuration\Handler::addIndicator(
triggers: [
new Trigger\ApplicationContext('Development')
],
indicators: [
new Indicator\Favicon([
new Image\Modifier\ReplaceModifier([
'path' => 'EXT:sitepackage/Resources/Public/Icons/favicon.png',
])
])
]
);

OverlayModifier
Overlay an additional image to the original favicon regarding the environment.
use KonradMichalik\Typo3EnvironmentIndicator\Configuration\Handler;
use KonradMichalik\Typo3EnvironmentIndicator\Configuration\Indicator;
use KonradMichalik\Typo3EnvironmentIndicator\Configuration\Trigger;
use KonradMichalik\Typo3EnvironmentIndicator\Image;
Configuration\Handler::addIndicator(
triggers: [
new Trigger\ApplicationContext('Development')
],
indicators: [
new Indicator\Favicon([
new Image\Modifier\OverlayModifier([
'path' => 'EXT:sitepackage/Resources/Public/Icons/favicon.png',
])
])
]
);

Additional optional configuration keys:
size
(float): The percentage size of the overlay. Default is0.
.5 position
(string): The position of the overlay. Default isbottom right
. Possible values arebottom left
,bottom right
,top left
,top right
.padding
(float): The percentage padding of the overlay. Default is0.
.1
ColorizeModifier
Overlay an additional image to the original favicon regarding the environment.
Warning
This modifier is only available with "Imagick" image driver.
use KonradMichalik\Typo3EnvironmentIndicator\Configuration\Handler;
use KonradMichalik\Typo3EnvironmentIndicator\Configuration\Indicator;
use KonradMichalik\Typo3EnvironmentIndicator\Configuration\Trigger;
use KonradMichalik\Typo3EnvironmentIndicator\Image;
Configuration\Handler::addIndicator(
triggers: [
new Trigger\ApplicationContext('Development')
],
indicators: [
new Indicator\Favicon([
new Image\Modifier\ColorizeModifier([
'color' => '#039BE5',
])
])
]
);

Additional optional configuration keys:
opacity
(float): Controls the opacity of the colorization. Default is1
.brightness
(integer): Controls the brightness of the colorization. Possible values are from-100
to100
.contrast
(integer): Controls the contrast of the colorization. Possible values are from-100
to100
.
Note
If you want to modify the image to your own need, implement a custom modifier class and add it to the configuration.