Search by

xddesigners / silverstripe-favicon-generator

RVXD

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

Statistics

Installs: 0

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

dev-main 2026-09-10 08:52 UTC

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 bundled PHP_ICO encoder (needs ext-gd).
  • Serves /favicon.ico via 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.