【问题标题】:TYPO3: modify root page of sitemap in plugin tx_seoTYPO3:在插件 tx_seo 中修改站点地图的根页面
【发布时间】:2020-11-17 15:50:14
【问题描述】:

我在插件 SEO 中成功配置了我的 TYPO3 v10 项目的站点地图,并在我的 templatesetup.ts 中使用official TYPO3 docs添加了自定义配置:

plugin.tx_seo {
  config {
    xmlSitemap {
      sitemaps {
        pages {
          provider = TYPO3\CMS\Seo\XmlSitemap\PagesXmlSitemapDataProvider
          config {
            excludedDoktypes = 3, 4, 6, 7, 199, 254, 255
            additionalWhere = no_index = 0
          }
        }
      }
    } 
  }
}

这里你可以看到我的sitemap.xml的几行:

我的目标是删除所有只有根“/”的行。如何为我的 sitemap.xml 设置除 1 之外的另一个 rootId?

感谢您的帮助。

【问题讨论】:

    标签: typo3 typo3-extensions typo3-10.x


    【解决方案1】:

    您需要参数rootPage。不幸的是,它是undocumented(还)。

    所以你的 TypoScript 应该是这样的:

    plugin.tx_seo {
      config {
        xmlSitemap {
          sitemaps {
            pages {
              provider = TYPO3\CMS\Seo\XmlSitemap\PagesXmlSitemapDataProvider
              config {
                excludedDoktypes = 3, 4, 6, 7, 199, 254, 255
                additionalWhere = no_index = 0
                rootPage = 135
              }
            }
          }
        } 
      }
    }
    

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-05-11
    • 1970-01-01
    • 2017-02-04
    • 1970-01-01
    • 2016-04-14
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多