Page Title
The favicon indicator fails exactly where editors and developers work a lot:
pinned tabs (favicon too small or hidden), bookmarks, browser history and task
switchers. A prefix or suffix in the <title> — e.g.
[STAGING] Page title — makes the environment instantly recognizable in
all of these contexts. It is a perfect complement to the favicon indicator.
Page Title Prefix Example
The indicator works in both frontend and backend:
- Frontend: a middleware decorates the final
<title>after the PageTitle API has resolved, so all existing page title providers (including SEO extensions) remain untouched. - Backend: the document title is prefixed/suffixed client-side. A
Mutationre-applies the decoration on backend SPA navigation (module switches), so the prefix persists.Observer
You can register the indicator in your ext_:
use KonradMichalik\Typo3EnvironmentIndicator\Configuration\Handler;
use KonradMichalik\Typo3EnvironmentIndicator\Configuration\Indicator;
use KonradMichalik\Typo3EnvironmentIndicator\Configuration\Trigger;
Handler::addIndicator(
triggers: [
new Trigger\ApplicationContext('Production/Staging')
],
indicators: [
new Indicator\General\PageTitle([
'prefix' => '[%context%] ',
])
]
);
Additional optional configuration keys:
prefix(string): Prepended to the page title (e.g.[STAGING]). Default is[%context%]. The placeholder%context%is replaced with the current application context.suffix(string): Appended to the page title. Also supports the%context%placeholder. Default is empty.
Note
The title is only decorated once. A title that already starts with the prefix (or ends with the suffix) is left untouched — safe for a shared full-page cache.
Note
SEO extensions that also manipulate the title are unaffected: the frontend decoration runs on the final rendered title, after the PageTitle API. If you deliberately enable the indicator in production (see above), this still applies there.
The page title indicator can be disabled per context via the
extension configuration
(frontend. and backend.).