fromholdio / silverstripe-svgenius
First-class SVG handling for Silverstripe CMS & front-end
Package info
github.com/fromholdio/silverstripe-svgenius
Type:silverstripe-vendormodule
pkg:composer/fromholdio/silverstripe-svgenius
2.1.0
2026-12-02 01:05 UTC
Requires
- enshrined/svg-sanitize: ^1.1.1
- silverstripe/framework: ^6.0.0
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
First-class SVG handling for Silverstripe CMS & front-end.
Requires Silverstripe 6+.
- SVGs can be uploaded into Asset Admin just like images
- Thumbnail of SVG is displayed on Asset Admin grid view
- Asset CMS fields adjusted to hide focuspoint field for SVGs when jonom/focuspoint is installed
- Retrieve height, width, orientation, and apply resizing by ratio, width or height using existing manipulation methods (Fit, FitMax, ScaleWidth, ScaleMaxWidth, ScaleHeight, ScaleMaxHeight)
- Can embed in front-end as an
tag, or embed the svg file contents
- SVG contents are passed through santisation library enshrined\svgSanitize
Note, this behaviour is not included out-of-the-box in Silverstripe due to the security risks inherent with user-supplied SVG files. Per above, this module does process SVGs through a sanitisation process, but this needs to be combined with your own strategies and in consideration of your use case to reach acceptable security.