lukasbableck/contao-svg-icon-picker-bundle

This bundle adds a svg icon picker widget to Contao.

Fund package maintenance!
lukasbableck

Installs: 2

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 0

Open Issues: 0

Type:contao-bundle

1.0.0 2025-08-19 13:02 UTC

This package is auto-updated.

Last update: 2025-08-28 07:50:19 UTC


README

This bundle adds a svg icon picker widget to Contao.

Configuration

Create a field in your DCA/RSCE/...

'icon' => [
	'inputType' => 'svgIconPicker',
	'eval' => [
		'sourceDirectory' => 'files/icons',
		'metadataDirectory' => 'files/icons/metadata',
		'tl_class' => 'clr'
	],
	'sql' => 'blob NULL',
],

Put your SVG icons in the specified sourceDirectory.
Icon metadata like search terms and labels can be provided via an icons.json, which has to be placed in the metadataDirectory. Providing metadata is completely optional.
Currently only an icons.json file in the scheme of the FontAwesome icons.json is supported.
Glyphs are not supported yet.

Usage

This extension provides a Twig function to render the SVG icon in your templates.

{{ svg_icon(icon) }}