tollwerk / tw-icons
Provide Icon-ViewHelper for including SVG icons in Fluid Templates
Package info
github.com/tollwerk/TYPO3-ext-tw_icons
Type:typo3-cms-extension
pkg:composer/tollwerk/tw-icons
Requires
- php: >= 7.4 < 8.5
- ext-dom: *
- typo3/cms-core: ^14
- typo3/cms-fluid-styled-content: ^14
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
Provides a ViewHelper to render SVG-Icons from a configurable source folder.
Installation
-
Install the extension with composer.
composer require tollwerk/tw-icons -
Add the site set "TwIcons" to your site configuration, save it and edit the site settings
-
Change "Icon Root Paths"
[twIcons.iconRootPaths]to the public folder(s) where your SVG-Icons are stored
Usage
Use the following ViewHelper to render Icons.
<!-- Will use the file "MyIconName.svg" and render that icon. --> <twicons:icon icon="MyIconName" />
ViewHelper arguments
debug bool, optional, default = true
If true and there is no file for the given icon (see argument "icon", below), a HTML comment like <!-- Unknown SVG icon "IconName.svg" --> will be returned instead.
icon string, required
Name of the SVG icon file found inside the folder(s) defined by twIcons.iconRootPaths, without the file type suffix. "Web" will be resolved to "Web.svg" or "web.svg".