tx_news 的 metaseo 和 pagetitle

metaseo and pagetitle for tx_news

我将 TYPO3 7.6 与 tx_news 和 metaseo 一起使用,一切正常,除了新闻的 PageTitle。

我有我的新闻 PageTitle,使用 metaseo 我有第二个 pageTitle "News Single view"。 如何删除 metaseo 标题? 或者如何使用 metaseo 获得正确的新闻标题?

以下为正确的新闻标题:

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]

在 EXT:metaseo 中,我在 setup.txt 中找到以下行:

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

尝试扩展您的 TypoScript 并删除 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#nopagetitlehttps://docs.typo3.org/typo3cms/TyposcriptReference/Setup/Config/Index.html#titletagfunction

使用 TypoScript 对象浏览器总是好的。

这是简单的解决方案,

[globalVar = TSFE:id = 27]

    config.noPageTitle = 2

    temp.newsTitle = RECORDS
    temp.newsTitle {
        dontCheckPid = 1
        tables = tx_news_domain_model_news
        source.data = GP:tx_news_pi1|news
        source.intval = 1
        conf.tx_news_domain_model_news = TEXT
        conf.tx_news_domain_model_news {
            field = title
            htmlSpecialChars = 1
        }
        wrap = <title>|</title>
    }
    page.headerData.1 >
    page.headerData.1 < temp.newsTitle

[global]

在这里,使用您的新闻详情页面 ID 而不是 27。这将使用当前的详情新闻标题覆盖默认页面标题。

资源: https://docs.typo3.org/typo3cms/extensions/news/AdministratorManual/BestPractice/IntegrationWithTypoScript/Index.html