Skip to content

Commit ef496a6

Browse files
authored
[FEATURE] Switch to using the RecordTitleProvider (#170)
Introduced with [Feature: #106232 - Provide record title tag provider](https://docs.typo3.org/permalink/changelog:feature-106232-1740166029) Releases: main
1 parent 068180a commit ef496a6

File tree

3 files changed

+4
-46
lines changed

3 files changed

+4
-46
lines changed

Classes/Controller/PostController.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
use T3docs\BlogExample\Domain\Repository\PersonRepository;
1414
use T3docs\BlogExample\Domain\Repository\PostRepository;
1515
use T3docs\BlogExample\Exception\NoBlogAdminAccessException;
16-
use T3docs\BlogExample\PageTitle\BlogPageTitleProvider;
16+
use TYPO3\CMS\Core\PageTitle\RecordTitleProvider;
1717
use TYPO3\CMS\Core\Pagination\SimplePagination;
1818
use TYPO3\CMS\Core\Type\ContextualFeedbackSeverity;
1919
use TYPO3\CMS\Extbase\Attribute\IgnoreValidation;
@@ -53,7 +53,7 @@ public function __construct(
5353
protected readonly PersonRepository $personRepository,
5454
protected readonly PostRepository $postRepository,
5555
protected readonly PropertyMapper $propertyMapper,
56-
protected readonly BlogPageTitleProvider $blogPageTitleProvider,
56+
protected readonly RecordTitleProvider $recordTitleProvider,
5757
) {}
5858

5959
/**
@@ -94,7 +94,7 @@ public function indexAction(
9494
->withExtensionName('blog_example')
9595
->withArguments(['currentPage' => $currentPage]);
9696
}
97-
$this->blogPageTitleProvider->setTitle($blog->getTitle());
97+
$this->recordTitleProvider->setTitle($blog->getTitle());
9898
if (empty($tag)) {
9999
$posts = $this->postRepository->findBy(['blog' => $blog]);
100100
} else {
@@ -143,7 +143,7 @@ public function showAction(
143143
#[IgnoreValidation]
144144
?Comment $newComment = null,
145145
): ResponseInterface {
146-
$this->blogPageTitleProvider->setTitle($post->getTitle());
146+
$this->recordTitleProvider->setTitle($post->getTitle());
147147
$this->view->assignMultiple([
148148
'post' => $post,
149149
'newComment' => $newComment,

Classes/PageTitle/BlogPageTitleProvider.php

Lines changed: 0 additions & 31 deletions
This file was deleted.

Configuration/Sets/BlogExample/setup.typoscript

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,4 @@ plugin.tx_blogexample {
2626
}
2727

2828
# Make postlist available as lib.blog_example_post_list
29-
3029
lib.blog_example_post_list < tt_content.list.20.blogexample_postlist
31-
32-
# Configure page title provider for blog post indexAction and showAction
33-
config {
34-
pageTitleProviders {
35-
blogExample {
36-
provider = T3docs\BlogExample\PageTitle\BlogPageTitleProvider
37-
before = record
38-
}
39-
}
40-
}

0 commit comments

Comments
 (0)