Commit 23d25c4f authored by Michal Cygankiewicz's avatar Michal Cygankiewicz

fix displaying extension icon

parent 1c367bbf
Pipeline #7794 passed with stages
in 2 minutes and 53 seconds
......@@ -14,6 +14,8 @@ namespace T3o\TerFe2\ViewHelpers;
* The TYPO3 project - inspiring people to share!
*/
use T3o\TerFe2\Domain\Model\Version;
/**
* Extension icon view helper
*/
......@@ -48,19 +50,17 @@ class ExtensionIconViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractT
parent::initializeArguments();
$this->registerUniversalTagAttributes();
$this->registerTagAttribute('alt', 'string', 'Specifies an alternate text for an image', true);
$this->registerArgument('version', Version::class, 'Version of extension', true);
}
/**
* Renders an extension icon for given version object
*
* @param \T3o\TerFe2\Domain\Model\Version $version Version object
* @return string Rendered image tag
*/
public function render(\T3o\TerFe2\Domain\Model\Version $version = null)
public function render()
{
if ($version === null) {
$version = $this->renderChildren();
}
$version = $this->arguments['version'];
$imageUrl = '';
$provider = $version->getExtensionProvider();
......
......@@ -70,6 +70,7 @@
<div class="col-md-9">
<header>
<h1>
<terfe2:extensionIcon version="{extension.lastVersion}" alt="{extension.lastVersion.title}" class="ter-ext-icon" />
<span title="Extension title: {extension.lastVersion.title}" itemprop="alternateName">{extension.lastVersion.title}</span>
</h1>
<h2>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment