diff --git a/public/typo3conf/ext/ep_theme/Classes/ViewHelpers/IconViewHelper.php b/public/typo3conf/ext/ep_theme/Classes/ViewHelpers/IconViewHelper.php index 5cb092ea..8e2a8826 100644 --- a/public/typo3conf/ext/ep_theme/Classes/ViewHelpers/IconViewHelper.php +++ b/public/typo3conf/ext/ep_theme/Classes/ViewHelpers/IconViewHelper.php @@ -4,49 +4,33 @@ namespace EP\EpTheme\ViewHelpers; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Extbase\Service\ImageService; -use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface; -use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper; -use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithRenderStatic; +use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractTagBasedViewHelper; -class IconViewHelper extends AbstractViewHelper +class IconViewHelper extends AbstractTagBasedViewHelper { - use CompileWithRenderStatic; - /** - * @var bool + * @var string */ - protected $escapeOutput = false; + protected $tagName = 'svg'; public function initializeArguments() { parent::initializeArguments(); - $this->registerArgument('icon', 'string', 'Icon name'); - $this->registerArgument('class', 'string', 'CSS classes'); + $this->registerUniversalTagAttributes(); + $this->registerArgument('icon', 'string', 'Icon name', true); } - /** - * @param array $arguments - * @param \Closure $renderChildrenClosure - * @param RenderingContextInterface $renderingContext - * @return mixed - */ - public static function renderStatic( - array $arguments, - \Closure $renderChildrenClosure, - RenderingContextInterface $renderingContext - ) + public function render(): string { $imageService = self::getImageService(); $sprite = $imageService->getImage('EXT:ep_theme/Resources/Public/images/icons_sprite.svg', null, false); $imageUrl = $sprite->getPublicUrl(); - return sprintf( - '', - $arguments['class'], - $imageUrl, - $arguments['icon'] - ); + $content = sprintf('', $imageUrl, $this->arguments['icon']); + $this->tag->setContent($content); + + return $this->tag->render(); } protected static function getImageService() diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Partials/City/Teaser.html b/public/typo3conf/ext/ep_theme/Resources/Private/Partials/City/Teaser.html index 38a3cdd3..d42b5a3b 100644 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Partials/City/Teaser.html +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Partials/City/Teaser.html @@ -6,9 +6,7 @@
- - - + {ep:icon(icon: 'flag-{city.country.code -> f:format.case(mode: \'lower\')}', class: 'w-8 h-6 absolute top-0 left-0')} diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Partials/ContactBar.html b/public/typo3conf/ext/ep_theme/Resources/Private/Partials/ContactBar.html index d5632ecd..22b9a78f 100644 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Partials/ContactBar.html +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Partials/ContactBar.html @@ -1,5 +1,6 @@
@@ -18,9 +19,7 @@ class="contact-bar__item" title="Telefonische Beratung" rel="nofollow"> - - - + {ep:icon(icon: 'phone', class: 'contact-bar__icon')} @@ -28,9 +27,7 @@ - - - + {ep:icon(icon: 'email', class: 'contact-bar__icon')}
{settings.contactFormToEmail}
@@ -40,9 +37,7 @@ title="Whatsapp" target="_blank" rel="nofollow"> - - - + {ep:icon(icon: 'whatsapp', class: 'contact-bar__icon')}
{settings.whatsApp}
@@ -51,9 +46,7 @@ class="contact-bar__item" target="_blank" rel="nofollow"> - - - + {ep:icon(icon: 'facebook', class: 'contact-bar__icon')}
Facebook
@@ -62,9 +55,7 @@ class="contact-bar__item" target="_blank" rel="nofollow"> - - - + {ep:icon(icon: 'instagram', class: 'contact-bar__icon')}
Instagram
@@ -73,18 +64,14 @@ class="contact-bar__item" target="_blank" rel="nofollow"> - - - + {ep:icon(icon: 'youtube', class: 'contact-bar__icon')}
Youtube
- - - + {ep:icon(icon: 'flag-gb', class: 'contact-bar__icon')}
English
@@ -92,9 +79,7 @@
- - - + {ep:icon(icon: 'flag-de', class: 'contact-bar__icon')}
Deutsch
diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Partials/Disrupter/Large.html b/public/typo3conf/ext/ep_theme/Resources/Private/Partials/Disrupter/Large.html index 41842ab5..550f6848 100644 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Partials/Disrupter/Large.html +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Partials/Disrupter/Large.html @@ -24,9 +24,7 @@ - - - + {ep:icon(icon: 'phone', class: 'w-10 h-10 text-white')}
Ihr habt Fragen? diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Partials/Disturber/Large.html b/public/typo3conf/ext/ep_theme/Resources/Private/Partials/Disturber/Large.html index a0366471..037a1cc5 100644 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Partials/Disturber/Large.html +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Partials/Disturber/Large.html @@ -25,9 +25,7 @@ - - - + {ep:icon(icon: 'phone', class: 'w-10 h-10 text-white')}
Ihr habt Fragen? diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Partials/EventDisturber.html b/public/typo3conf/ext/ep_theme/Resources/Private/Partials/EventDisturber.html index 7e37d273..bf8778ec 100644 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Partials/EventDisturber.html +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Partials/EventDisturber.html @@ -14,9 +14,7 @@