Download the PHP package innoweb/silverstripe-svg-sprite-icon-field without Composer
On this page you can find all versions of the php package innoweb/silverstripe-svg-sprite-icon-field. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download innoweb/silverstripe-svg-sprite-icon-field
More information about innoweb/silverstripe-svg-sprite-icon-field
Files in innoweb/silverstripe-svg-sprite-icon-field
Package silverstripe-svg-sprite-icon-field
Short Description Adds an icon selector field to Silverstripe that uses an SVG sprite.
License BSD-3-Clause
Informations about the package silverstripe-svg-sprite-icon-field
SVG Sprite Icon Field
Introduction
This module adds an icon selector field to Silverstripe that uses an SVG sprite.
The module is based on jaedb/iconfield, but it uses an SVG sprite instead of individual images.
By default, the free version of the FontAwesome regular icons are used.
Requirements
- Silverstripe ^6
- PHP DOM extension (ext-dom)
Installation
Install the module using composer:
Then run dev/build.
Configuration
The module uses the following configuration options:
Usage
Add an icon field to your DataObject:
Then add the form field to your DataObject:
In your template, you can then use the field like so:
I recommend adding the following default CSS to your project:
You can also change the colour of the icon by using CSS:
And you can change the size of the icon by using CSS:
And of course you can override the template Innoweb\SvgSpriteIconField\Icon in your theme if you like.
Changelog
See Changelog
License
BSD 3-Clause License, see License
Credits
- jaedb, for writing the original module
- PlasticStudio, for their SS5 upgrade and improvements