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
README
Provides a ViewHelper to render SVG-Icons from a configurable source folder.
Installation
-
Install the extension with composer.
composer require tollwerk/tw-icons -
Include the TypoScript template "Tollwerk SVG-Icons" into your root TypoScript template.
-
Set
plugin.tx_twicons.settings.iconRootPathto the public folder 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 defined by plugin.tx_twicons.settings.iconRootPath. So "Web" will be resolved to "Web.svg" or "web.svg".