Commit ee45fbae authored by Michal Cygankiewicz's avatar Michal Cygankiewicz

using pageRenderer setMetaTag

parent 28ef3f39
Pipeline #7807 passed with stages
in 3 minutes and 26 seconds
......@@ -16,6 +16,7 @@ namespace T3o\TerFe2\Controller;
use T3o\TerFe2\Validation\Validator\ComposerNameValidator;
use TYPO3\CMS\Core\Database\ConnectionPool;
use TYPO3\CMS\Core\Page\PageRenderer;
use TYPO3\CMS\Core\Utility\GeneralUtility;
/**
......@@ -193,10 +194,11 @@ class ExtensionController extends \T3o\TerFe2\Controller\AbstractController
$documentationLink = $documentationService->getDocumentationLink($extension->getExtKey(), $extension->getLastVersion()->getVersionString(), true);
$this->view->assign('documentationLink', $documentationLink);
$pageRenderer = $this->objectManager->get(\TYPO3\CMS\Core\Page\PageRenderer::class);
$pageRenderer->addMetaTag('<meta name="description" content="' . htmlspecialchars($extension->getLastVersion()->getDescription()) . '" />');
/** @var PageRenderer $pageRenderer */
$pageRenderer = $this->objectManager->get(PageRenderer::class);
$pageRenderer->setMetaTag('name', 'description', htmlspecialchars($extension->getLastVersion()->getDescription()));
if ($extension->getTags()->count() > 0) {
$pageRenderer->addMetaTag('<meta name="keywords" content="' . htmlspecialchars(implode(',', $extension->getTags()->toArray())) . '" />');
$pageRenderer->setMetaTag('name', 'keywords', htmlspecialchars(implode(',', $extension->getTags()->toArray())));
}
// gets all other extensions from the owner
......
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