xddesigners / silverstripe-favicon-generator
Generate a multi-size favicon.ico and the matching <head> tags from a single favicon image uploaded in Site settings.
Package info
github.com/xddesigners/silverstripe-favicon-generator
Type:silverstripe-vendormodule
pkg:composer/xddesigners/silverstripe-favicon-generator
Requires
- ext-gd: *
- silverstripe/cms: ^6
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-09-10 08:52:33 UTC
README
Generate a multi-size favicon.ico from a single favicon image uploaded in
Settings, and output the matching <head> tags on every page. A
favicon.ico route is served straight from the generated file.
Features
- Upload one favicon image (PNG) in Site settings; the module builds a
multi-resolution
favicon.ico(16/32/48/64) with the bundledPHP_ICOencoder (needsext-gd). - Serves
/favicon.icovia a controller from the generated file. - Injects
<link rel="shortcut icon">plus apple-touch / MS-tile tags. - Locale-aware: when Fluent is installed the favicon (a single global asset) is only generated in the default locale.
Requirements
- Silverstripe CMS ^6
- PHP ^8.1 with the GD extension
Installation
composer require xddesigners/silverstripe-favicon-generator dev/build flush=all
Usage
Open Settings → Favicon, upload a square PNG as Favicon image and save.
The favicon.ico is generated automatically on save (and regenerated when the
source image changes). Optionally upload a ready-made .ico in Favicon file.
Configuration
XD\FaviconGenerator\Extensions\SiteConfigExtension: favicon_tab: 'Root.Favicon' favicon_folder: 'favicon' favicon_allowed_extensions: - 'png'
Maintenance task
favicon-cleanup removes duplicate favicon*.ico assets (e.g. left by earlier
versions that created a new file on every save), clears the Site settings link
and regenerates a single clean favicon.ico:
vendor/bin/sake tasks:favicon-cleanup
License
BSD-3-Clause. See LICENSE.