Jump to content

Favicons & web app manifest

How favicons work in mpc/mp-core: asset files, Fluid partial, site configuration, and optional RealFaviconGenerator tooling.

MP-Core logo
 

Do not replace Resources/Private/Partials/Page/Favicons.html with static HTML from RealFaviconGenerator. The partial is a Fluid template that reads site configuration (or falls back to bundled files under Resources/Public/Favicons/).

 

Architecture

 
flowchart LR
  subgraph assets [Static assets]
    BuildStatic["Build/Assets/Static/Favicons/"]
    Public["Resources/Public/Favicons/"]
    BuildStatic -->|Vite publicDir| Public
  end
  subgraph site [Site configuration]
    SiteCfg["config/sites/*/config.yaml\n(site.configuration.*)"]
  end
  subgraph output [Frontend head]
    Partial["Favicons.html\nheaderData 2039"]
    Manifest["Manifest.html\npageType 8412"]
    Partial --> SiteCfg
    Partial --> Public
    Manifest --> Public
  end
PieceLocationRole
Favicon filesBuild/Assets/Static/Favicons/ → Resources/Public/Favicons/Copied by Vite (publicDir); default fallbacks
Head partialResources/Private/Partials/Page/Favicons.htmlEmits <link rel="icon">, manifest link, optional page meta
TypoScriptConfiguration/TypoScript/Setup/Page/Page.Favicon.typoscriptpage.headerData.2039 = FLUIDTEMPLATE
Site Setting overridepageFaviconsFileAlternate partial path (95.SitePresentationOverrides.typoscript)
Dynamic manifestConfiguration/TypoScript/Setup/40.Page.Scripts.typoscripttypeNum = 8412 → Manifest.html (JSON)
Site fields (backend)Configuration/SiteConfiguration/Overrides/sites.phpFile-link fields on the site record

Runtime behaviour (Favicons.html)

Included via page.headerData.2039 (see Page.Favicon.typoscript and pageFaviconsFile in Site Settings).

If any of these site configuration keys is set, the site-specific branch is used:

  • favicon-96x96-png
  • faviconIco
  • faviconSvg
  • apple-touch-icon
  • webmanifest
Site fieldOutput
favicon-96x96-png<link rel="icon" sizes="96x96" type="image/png">
faviconIco<link rel="shortcut icon">
faviconSvg<link rel="icon" type="image/svg+xml">
apple-touch-icon<link rel="apple-touch-icon" sizes="180x180">
webmanifest<link rel="manifest"> → linked FAL file
(no webmanifest file)<link rel="manifest" href="{f:uri.page(pageType: 8412)}"> → dynamic JSON

If none of those keys are set, defaults from the extension are used:

FilePath
PNG 96×96EXT:mp_core/Resources/Public/Favicons/favicon-96x96.png
ICOEXT:mp_core/Resources/Public/Favicons/favicon.ico
SVGEXT:mp_core/Resources/Public/Favicons/favicon.svg
Apple touchEXT:mp_core/Resources/Public/Favicons/apple-touch-icon.png
Manifestf:uri.page(pageType: 8412) (dynamic)

All href values go through f:uri.image (site files) or f:uri.page (manifest).

Extra <meta> tags (same partial)

When page data is available:

ConditionMeta tag
{data.keywords}keywords
{data.lastUpdated}last-modified
{data.author}author
{data.author_email}email

Site record (backend)

Site Management → Sites → [site] → Configuration — tab Favicons (sites.php):

FieldPurpose
favicon-96x96-pngPrimary PNG favicon
faviconIcofavicon.ico
faviconSvgSVG favicon
apple-touch-iconiOS home screen
webmanifestStatic site.webmanifest file (optional; else dynamic manifest)
web-app-manifest-192x192PWA icon 192×192 (for static manifest packages)
web-app-manifest-512x512PWA icon 512×512

Set file links in the UI or in config/sites/[site]/config.yaml, for example:

 
faviconSvg: 't3://file?uid=123'
favicon-96x96-png: 't3://file?uid=124'
 

Labels and hints: Resources/Private/Language/locallang_db.xlf (site.configuration.*).

Dynamic web manifest (pageType 8412)

Defined in Configuration/TypoScript/Setup/40.Page.Scripts.typoscript:

  • URL: same page with typeNum=8412 (via f:uri.page(pageType: 8412) in Favicons.html)
  • Template: Resources/Private/Partials/Page/Manifest.html
  • Content-Type: application/manifest+json, cacheable 24h

Manifest.html builds JSON with:

  • name / short_name from site.configuration.pwaName / pwaShortName, else site title / identifier
  • Icons: web-app-manifest-192x192.png and web-app-manifest-512x512.png under Resources/Public/Favicons/
  • Default theme_color / background_color: #333333

Optional PWA keys (pwaName, pwaShortName) can be added in config.yaml even though they are not registered in sites.php TCA yet.

Generating / updating icon files

Use RealFaviconGenerator when you need a full icon set (ICO, PNG sizes, Apple touch, manifest icons).

Option A — Website (quick)

  1. Upload master image (512×512 PNG or SVG recommended).
  2. Download the ZIP.
  3. Extract into Build/Assets/Static/Favicons/ (not into Resources/Public/ directly).
  4. From Build/: npm run build or npm run watch (copies static assets to Resources/Public/Favicons/).

Option B — CLI (CI-friendly)

Example using the checked-in Build/favicon-settings.json (adjust path, names, and colours for your project):

 
cd Build
npx realfavicon generate ./Assets/Images/favicon.png favicon-settings.json favicon-output.json ./Assets/Static/Favicons
npx realfavicon inject favicon-output.json ./Assets/Static/Favicons ./Assets/Static/Favicons/output.html
npm run build
 

Generated artefacts:

FileUse
favicon-output.jsonGenerator metadata (optional in VCS)
output.htmlReference only — sample static <head> tags; do not paste into Favicons.html
Icon files + site.webmanifestShipped via Vite to Resources/Public/Favicons/

Update path in favicon-settings.json to match your deployed asset path if you serve icons from a fixed URL prefix.

Expected filenames (defaults)

After a full generation, these should exist under Resources/Public/Favicons/:

  • favicon.svg, favicon.ico, favicon-96x96.png
  • apple-touch-icon.png
  • web-app-manifest-192x192.png, web-app-manifest-512x512.png
  • site.webmanifest (optional if you use dynamic manifest only)

Site Settings

KeyDefault
pageFaviconsFileEXT:mp_core/Resources/Private/Partials/Page/Favicons.html

Override in Site Settings or settings.yaml only if you provide a custom Fluid partial.

Validation

  • RealFaviconGenerator favicon checker
  • In the browser: inspect <head> links and request ?type=8412 for manifest JSON
  • CLI update check (if you keep favicon-output.json): npx real-favicon check-for-update favicon-output.json

Share page