Issue Feature Closed

#101393Extend PageTitle API with possibility to set "indexedDocTitle" accordingly

Jan Kornblum 07/20/23, 07:23 updated 10/16/26, 17:00

Description

PageTitle API should be extended with possibility to modify “indexedDocTitle” accordingly, in the same way as regular “title” can already be modified:

$pageTitleProvider = GeneralUtility::makeInstance(MyCustomPageTitleProvider::class);
$pageTitleProvider->setTitle($title);
$pageTitleProvider->setIndexedDocTitle($indexedDocTitle);

A property “$indexedDocTitle” as well as a getter “getIndexedDocTitle()” should be added to “AbstractPageTitleProvider” class, with the relevant functional implementation in behind:

abstract class AbstractPageTitleProvider implements PageTitleProviderInterface, SingletonInterface
{
    /**
     * @var string
     */
    protected $title = '';

    /**
     * @var string
     */
    protected $indexedDocTitle = '';

    /**
     * @return string
     */
    public function getTitle(): string
    {
        return $this->title;
    }

    /**
     * @return string
     */
    public function getIndexedDocTitle(): string
    {
        return $this->indexedDocTitle;
    }
}

So any developer can add a setter “setIndexedDocTitle()” esily into his own extended page title provider:

class MyCustomPageTitleProvider extends AbstractPageTitleProvider
{
    /**
     * @param string $title
     */
    public function setTitle($title) {
        $this->title = $title;
    }

    /**
     * @param string $indexedDocTitle
     */
    public function setIndexedDocTitle($indexedDocTitle) {
        $this->indexedDocTitle= $indexedDocTitle;
    }
}

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.

History 7

  1. Tobias Gaertner commented and changed PHP Version 7.4 8.2 <span data-processor="relativetime" data-value="2025-08-07T19:33:54+00:00" > 08/07/25, 19:33 </span>

    I’m looking into it.

  2. Tobias Gaertner commented and changed status New Needs Feedback priority Should have Could have PHP Version 8.2 7.4 <span data-processor="relativetime" data-value="2025-08-07T20:59:39+00:00" > 08/07/25, 20:59 </span>

    What is the related TYPO3 version?

    The property indexedDocTitle was removed from TypoScriptFrontendController and the functionality was moved to indexed_search sys extension.
    As far as I can see the property indexedDocTitle is nowhere used anymore.

    So we need feedback on if this is still relevant and what would be the exact usecase.

  3. Jan Kornblum commented <span data-processor="relativetime" data-value="2025-11-05T10:36:13+00:00" > 11/05/25, 10:36 </span>

    I can’t remember the version exactly at the moment, but it was at least 11, or even 12. If there still is any indexed doc title used in behind in current versions (I don’t have the time to find it out myself currently), this issue should stay open. Otherwise you can close.

  4. Riccardo De Contardi commented <span data-processor="relativetime" data-value="2025-11-05T11:19:26+00:00" > 11/05/25, 11:19 </span>

    Thank you for your feedback.

    As far as I can see the only occurrences of indexedDocTitle are in

    sysext/indexed_search/Classes/EventListener/FrontendGenerationPageIndexingTrigger.php
    sysext/indexed_search/Classes/Indexer.php

  5. Georg Ringer commented and changed status Needs Feedback Closed <span data-processor="relativetime" data-value="2026-10-16T17:00:08+00:00" > 10/16/26, 17:00 </span>

    Thanks for the report and the feedback.

    I checked this on main (v15.0-dev). The property indexedDocTitle no longer exists in TypoScriptFrontendController, the indexing logic lives in EXT:indexed_search now.

    TYPO3\CMS\IndexedSearch\EventListener\FrontendGenerationPageIndexingTrigger passes the result of PageTitleProviderManager::getTitle() as indexedDocTitle to the Indexer, which uses it as the title of the indexed page. This means a custom page title provider already determines the title that ends up in the search index, no additional API on AbstractPageTitleProvider is needed for that.

    What is not possible is an index title that differs from the <title> of the page. Adding this to PageTitleProviderInterface would be a breaking change, and no concrete use case for a diverging index title has been provided so far. If one exists, a PSR-14 event in EXT:indexed_search would be the way to go instead of extending the page title provider API.

    Closing this issue as the described behaviour is covered by the current implementation.

    If this is still valid for you in v14, please open a new issue and provide information how to reproduce it. Thanks!