diff --git a/Classes/ViewHelpers/Link/ArchiveViewHelper.php b/Classes/ViewHelpers/Link/ArchiveViewHelper.php index 3cab6af5..a113f8d1 100644 --- a/Classes/ViewHelpers/Link/ArchiveViewHelper.php +++ b/Classes/ViewHelpers/Link/ArchiveViewHelper.php @@ -47,25 +47,22 @@ public function render(): string $year = (int)$this->arguments['year']; $month = (int)$this->arguments['month']; $pageUid = (int)$this->getTypoScriptFrontendController()->tmpl->setup['plugin.']['tx_blog.']['settings.']['archiveUid']; - $additionalParams = [ - 'tx_blog_archive' => [ - 'year' => $year, - ], + $arguments = [ + 'year' => $year ]; if ($month > 0) { - $additionalParams['tx_blog_archive']['month'] = $month; + $arguments['month'] = $month; } $uriBuilder = $this->renderingContext->getControllerContext()->getUriBuilder(); $uriBuilder->reset() ->setTargetPageUid($pageUid) - ->setUseCacheHash(true) - ->setArguments($additionalParams); + ->setUseCacheHash(true); if ($rssFormat) { $uriBuilder ->setFormat('rss') ->setTargetPageType($this->getTypoScriptFrontendController()->tmpl->setup['blog_rss_archive.']['typeNum']); } - $uri = $uriBuilder->uriFor('listPostsByDate', [], 'Post', 'Blog'); + $uri = $uriBuilder->uriFor('listPostsByDate', $arguments, 'Post', 'Blog', 'Archive'); if ($uri !== '') { $this->tag->addAttribute('href', $uri); $this->tag->setContent($this->renderChildren()); diff --git a/Classes/ViewHelpers/Link/AuthorViewHelper.php b/Classes/ViewHelpers/Link/AuthorViewHelper.php index 4cfd51df..dbff0118 100644 --- a/Classes/ViewHelpers/Link/AuthorViewHelper.php +++ b/Classes/ViewHelpers/Link/AuthorViewHelper.php @@ -73,17 +73,11 @@ protected function buildUriFromDetailsPage(Author $author, bool $rssFormat) */ protected function buildUriFromDefaultPage(Author $author, bool $rssFormat) { - $uriBuilder = $this->getUriBuilder( - (int)$this->getTypoScriptFrontendController()->tmpl->setup['plugin.']['tx_blog.']['settings.']['authorUid'], - [ - 'tx_blog_authorposts' => [ - 'author' => $author->getUid(), - ], - ], - $rssFormat - ); - - return $this->buildAnchorTag($uriBuilder->uriFor('listPostsByAuthor', [], 'Post'), $author, 'Blog'); + $uriBuilder = $this->getUriBuilder((int)$this->getTypoScriptFrontendController()->tmpl->setup['plugin.']['tx_blog.']['settings.']['authorUid'], [], $rssFormat); + $arguments = [ + 'author' => $author->getUid(), + ]; + return $this->buildAnchorTag($uriBuilder->uriFor('listPostsByAuthor', $arguments, 'Post', 'Blog', 'AuthorPosts'), $author); } /** diff --git a/Classes/ViewHelpers/Link/CategoryViewHelper.php b/Classes/ViewHelpers/Link/CategoryViewHelper.php index 5cc82880..e4cd62a5 100644 --- a/Classes/ViewHelpers/Link/CategoryViewHelper.php +++ b/Classes/ViewHelpers/Link/CategoryViewHelper.php @@ -47,22 +47,19 @@ public function render(): string /** @var Category $category */ $category = $this->arguments['category']; $pageUid = (int)$this->getTypoScriptFrontendController()->tmpl->setup['plugin.']['tx_blog.']['settings.']['categoryUid']; - $additionalParams = [ - 'tx_blog_category' => [ - 'category' => $category->getUid(), - ], + $arguments = [ + 'category' => $category->getUid(), ]; $uriBuilder = $this->renderingContext->getControllerContext()->getUriBuilder(); $uriBuilder->reset() ->setTargetPageUid($pageUid) - ->setUseCacheHash(true) - ->setArguments($additionalParams); + ->setUseCacheHash(true); if ($rssFormat) { $uriBuilder ->setFormat('rss') ->setTargetPageType($this->getTypoScriptFrontendController()->tmpl->setup['blog_rss_category.']['typeNum']); } - $uri = $uriBuilder->uriFor('listPostsByCategory', [], 'Post', 'Blog'); + $uri = $uriBuilder->uriFor('listPostsByCategory', $arguments, 'Post', 'Blog', 'Category'); if ($uri !== '') { $linkText = $this->renderChildren() ?: $category->getTitle(); diff --git a/Classes/ViewHelpers/Link/TagViewHelper.php b/Classes/ViewHelpers/Link/TagViewHelper.php index b2c1c5b7..3e398270 100644 --- a/Classes/ViewHelpers/Link/TagViewHelper.php +++ b/Classes/ViewHelpers/Link/TagViewHelper.php @@ -47,22 +47,19 @@ public function render(): string /** @var Tag $tag */ $tag = $this->arguments['tag']; $pageUid = (int)$this->getTypoScriptFrontendController()->tmpl->setup['plugin.']['tx_blog.']['settings.']['tagUid']; - $additionalParams = [ - 'tx_blog_tag' => [ - 'tag' => $tag->getUid(), - ], + $arguments = [ + 'tag' => $tag->getUid(), ]; $uriBuilder = $this->renderingContext->getControllerContext()->getUriBuilder(); $uriBuilder->reset() ->setTargetPageUid($pageUid) - ->setUseCacheHash(true) - ->setArguments($additionalParams); + ->setUseCacheHash(true); if ($rssFormat) { $uriBuilder ->setFormat('rss') ->setTargetPageType($this->getTypoScriptFrontendController()->tmpl->setup['blog_rss_tag.']['typeNum']); } - $uri = $uriBuilder->uriFor('listPostsByTag', [], 'Post', 'Blog'); + $uri = $uriBuilder->uriFor('listPostsByTag', $arguments, 'Post', 'Blog', 'Tag'); if ($uri !== '') { $linkText = $this->renderChildren() ?: $tag->getTitle(); $this->tag->addAttribute('href', $uri);