Project

General

Profile

Actions

Feature #101393

open

Extend PageTitle API with possibility to set "indexedDocTitle" accordingly

Added by Jan Kornblum over 1 year ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
SEO
Target version:
-
Start date:
2023-07-20
Due date:
% Done:

0%

Estimated time:
PHP Version:
7.4
Tags:
page title api, indexeddoctitle, indexed, doc, title, indexed_search
Complexity:
Sprint Focus:

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;
    }
}

No data to display

Actions

Also available in: Atom PDF