Search code examples
typo3tx-news

metaseo and pagetitle for tx_news


I use TYPO3 7.6 with tx_news and metaseo, all works fine, except the PageTitle for the news.

I have my news PageTitle and with metaseo I get a second pageTitle "News Single view". How can I remove the metaseo title? Or how can I get the right news title with metaseo?

The following gives the right news title:

config.noPageTitle = 2

[globalVar = GP:tx_news_pi1|news > 0]
    temp.newsTitle = RECORDS
    temp.newsTitle {
        source = {GP:tx_news_pi1|news}
        source.insertData = 1
        tables = tx_news_domain_model_news
        conf {
            tx_news_domain_model_news >
            tx_news_domain_model_news = TEXT
            tx_news_domain_model_news {
                field = title
                noTrimWrap = || News|
            }
        }
    }
[global]
page.headerData {
    190 >
    190 = COA
    190 < temp.newsTitle
    #190.wrap = <title>|</title>
    190.wrap = <title>| Вера бахаи в Беларуси</title>
}

[globalVar = GP:L = 1]
    page.headerData {
        190 >
        190 = COA
        190 < temp.newsTitle
        #190.wrap = <title>|</title>
        190.wrap = <title>| Суполкi бахаi ў Беларусi</title>
    }
[global]

Solution

  • In EXT:metaseo I found in setup.txt the following line:

    config.titleTagFunction = Metaseo\Metaseo\Page\Part\PagetitlePart->main
    

    Try to extend your TypoScript and delete config.titleTagFunction

    [globalVar = GP:tx_news_pi1|news > 0]
        config.noPageTitle = 2
        config.titleTagFunction >
    [global]
    

    @see https://docs.typo3.org/typo3cms/TyposcriptReference/Setup/Config/Index.html#nopagetitle and https://docs.typo3.org/typo3cms/TyposcriptReference/Setup/Config/Index.html#titletagfunction

    It's always good to use the TypoScript Object Browser.