@@ -15,8 +15,8 @@ Based on the priority of the providers, the
1515providers if a title is given by the provider. It will start with the highest
1616priority and will end with the lowest priority.
1717
18- By default, the Core ships two providers. If you have installed the :doc: ` system
19- extension SEO <ext_seo:Index> `, the provider with the (by default) highest
18+ By default, the Core ships two providers. If you have installed
19+ :composer: ` typo3/cms-seo `, the provider with the (by default) highest
2020priority will be the :php: `\T YPO3\C MS\S eo\P ageTitle\S eoTitlePageTitleProvider `.
2121When an editor has set a value for the SEO title in the page properties of the
2222page, this provider will provide that title to the
@@ -40,6 +40,8 @@ integrator can define the priority of the providers for his project.
4040
4141.. index :: PageTitle; Custom PageTitleProvider
4242
43+ .. _page-title-provider-custom :
44+
4345Create your own page title provider
4446===================================
4547
@@ -49,6 +51,8 @@ the page record will not be the correct title. To make sure to display the
4951correct page title, you have to create your own page title provider. It is
5052quite easy to create one.
5153
54+ .. _page-title-provider-custom-example :
55+
5256Example: Set the page title from your extension's controller
5357------------------------------------------------------------
5458
@@ -57,27 +61,29 @@ First, create a PHP class in your extension that implements the
5761extending :php: `\T YPO3\C MS\C ore\P ageTitle\A bstractPageTitleProvider `. Within
5862this method you can create your own logic to define the correct title.
5963
60- .. literalinclude :: _ExampleSetInController/_MyOwnPageTitleProvider.php
64+ .. literalinclude :: _PageTitleProvider/ _ExampleSetInController/_MyOwnPageTitleProvider.php
6165 :caption: EXT:my_extension/Classes/PageTitle/MyOwnPageTitleProvider.php
6266
6367Usage example in an :ref: `Extbase <extbase >` controller:
6468
65- .. literalinclude :: _ExampleSetInController/_SomeController.php
69+ .. literalinclude :: _PageTitleProvider/ _ExampleSetInController/_SomeController.php
6670 :caption: EXT:my_extension/Classes/Controller/SomeController.php
6771
6872Configure the new page title provider in your TypoScript setup:
6973
70- .. literalinclude :: _ExampleSetInController/_setup.typoscript
74+ .. literalinclude :: _PageTitleProvider/ _ExampleSetInController/_setup.typoscript
7175 :language: typoscript
7276 :caption: EXT:my_sitepackage/Configuration/TypoScript/setup.typoscript
7377
78+ .. _page-title-provider-custom-site-config :
79+
7480Example: Use values from the site configuration in the page title
7581-----------------------------------------------------------------
7682
7783If you want to use data from the :ref: `site configuration <sitehandling >`, for
7884example the site title, you can implement a page title provider as follows:
7985
80- .. literalinclude :: _ExampleWebsiteTitle /_WebsiteTitleProvider.php
86+ .. literalinclude :: _PageTitleProvider /_WebsiteTitleProvider.php
8187 :caption: EXT:my_sitepackage/Classes/PageTitle/WebsiteTitleProvider.php
8288
8389.. versionchanged :: 13.0
@@ -93,7 +99,7 @@ and PHP Cache`.
9399
94100Configure the new page title provider to be used in your TypoScript setup:
95101
96- .. literalinclude :: _ExampleWebsiteTitle/_setup .typoscript
102+ .. literalinclude :: _PageTitleProvider/_website .typoscript
97103 :language: typoscript
98104 :caption: EXT:my_sitepackage/Configuration/TypoScript/setup.typoscript
99105
@@ -109,22 +115,18 @@ you can change this by loading your custom provider before `seo`.
109115.. index :: PageTitle; Priority
110116
111117.. _define-the-priority-of-pagetitleproviders :
118+
112119Define the priority of PageTitleProviders
113120=========================================
114121
115122The priority of the providers is set by the TypoScript property
116- :typoscript: `config.pageTitleProviders `. This way an integrator is able to set
117- the priorities for his project and can even have conditions in place.
123+ `config.pageTitleProviders <https://docs.typo3.org/permalink/t3tsref:confval-config-pagetitleproviders >`_.
124+ This way an integrator is able to set
125+ the priorities for their project and can even have conditions in place.
118126
119127By default, the Core has the following setup:
120128
121- .. code-block :: typoscript
122-
123- config.pageTitleProviders {
124- record {
125- provider = TYPO3\CMS\Core\PageTitle\RecordPageTitleProvider
126- }
127- }
129+ .. literalinclude :: _PageTitleProvider/_core.typoscript
128130
129131The sorting of the providers is based on the :typoscript: `before ` and
130132:typoscript: `after ` parameters. If you want a provider to be handled before a
@@ -134,17 +136,7 @@ do the same with :typoscript:`after`.
134136If you have installed the system extension SEO, you will also get a second
135137provider. The configuration will be:
136138
137- .. code-block :: typoscript
138-
139- config.pageTitleProviders {
140- record {
141- provider = TYPO3\CMS\Core\PageTitle\RecordPageTitleProvider
142- }
143- seo {
144- provider = TYPO3\CMS\Seo\PageTitle\SeoTitlePageTitleProvider
145- before = record
146- }
147- }
139+ .. literalinclude :: _PageTitleProvider/_pageTitleProviders.typoscript
148140
149141First the :php: `SeoTitlePageTitleProvider ` (because it will be handled before
150142:typoscript: `record `) and, if this providers did not provide a title, the
0 commit comments