【问题标题】:metaseo and pagetitle for tx_newstx_news 的 metaseo 和 pagetitle
【发布时间】:2017-04-17 16:05:57
【问题描述】:

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

我有我的新闻 PageTitle 和 metaseo 我得到第二个 pageTitle“新闻单视图”。 如何删除 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]

【问题讨论】:

  • 你不需要线路190 = COA。您稍后用190 &lt; temp.newsTitle 覆盖它们,并且 temp.newsTitle 是一个内容对象类型 RECORDS。

标签: typo3 tx-news


【解决方案1】:

在 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]

@见https://docs.typo3.org/typo3cms/TyposcriptReference/Setup/Config/Index.html#nopagetitlehttps://docs.typo3.org/typo3cms/TyposcriptReference/Setup/Config/Index.html#titletagfunction

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

【讨论】:

    【解决方案2】:

    这是一个简单的解决方案,

    [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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多