markussom / sitemap-generator
用于页面和记录的简单易用的网站地图生成器。
1.5.2
2020-01-20 02:11 UTC
Requires
- php: >=7.1.0,<7.4.99
- typo3/cms-core: >=7.6.20,<10.0.0
Requires (Dev)
- mikey179/vfsstream: ~1.6.0
- nimut/testing-framework: ^4.0
- typo3/minimal: *
Suggests
Replaces
- sitemap_generator: 1.5.2
- typo3-ter/sitemap-generator: 1.5.2
This package is auto-updated.
Last update: 2024-09-21 04:59:01 UTC
README
构建状态
安装
准备:包含静态TypoScript
该扩展包含一些需要包含的TypoScript代码。
- 切换到您网站的根页面。
- 切换到模板模块并选择“信息/修改”。
- 点击链接“编辑整个模板记录”并切换到“包含”选项卡。
- 在“包含静态(来自扩展)”字段中选择“Sitemap Generator (sitemap_generator)”
- 您可以覆盖根页面ID插件.tx_sitemapgenerator.settings.urlEntries.pages.rootPageId
- 您可以添加自定义的doktypes。默认情况下,sitemap.xml仅列出具有“doktype=1”的正常页面。该选项接受以逗号分隔的数字列表。plugin.tx_sitemapgenerator.settings.urlEntries.pages.allowedDoktypes
- 网站地图在根页面(页类型为1449874941)"/index.php?id=1&type=1449874941"上可用
页面
plugin.tx_sitemapgenerator { urlEntries { pages = 1 pages { rootPageId = 1 allowedDoktypes = 1 additionalWhere = doktype!=6 } } }
插件集成
plugin.tx_sitemapgenerator { urlEntries { news = 1 news { active = 1 table = tx_news_domain_model_news additionalWhere = pid!=0 orderBy = title DESC limit = 0,10 lastmod = tstamp url = TEXT url { typolink.parameter = 9 typolink.additionalParams = &tx_news_pi1[controller]=News&tx_news_pi1[action]=detail&tx_news_pi1[news]={field:uid} typolink.additionalParams.insertData = 1 typolink.useCacheHash = 1 typolink.returnLast = url typolink.forceAbsoluteUrl = 1 } } } }
未翻译时隐藏
未翻译的记录将不会显示。
plugin.tx_sitemapgenerator.urlEntries.pages { hidePagesIfNotTranslated = 1 } plugin.tx_sitemapgenerator.urlEntries.news { hideIfNotTranslated = 1 }
附加字段
plugin.tx_sitemapgenerator.urlEntries.news { changefreq = dbfield_for_changefreq priority = dbfield_for_priority }
字段的自定义值
您可以使用TYPO3 TypoScript语法来填充字段
plugin.tx_sitemapgenerator.urlEntries.news { changefreq = TEXT changefreq.value = daily }
RealURL为美丽的sitemap.xml URL
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']['_DEFAULT'] = [ 'fileName' => [ 'defaultToHTMLsuffixOnPrev' => 0, 'acceptHTMLsuffix' => 1, 'index' => [ 'sitemap.xml' => [ 'keyValues' => [ 'type' => 1449874941, ] ] ] ] ];
Google 新闻-Sitemap
https://support.google.com/news/publisher/answer/74288?hl=en
为tx_news激活
plugin.tx_sitemapgenerator.googleNewsUrlEntry = 1
RealURL为美丽的sitemap_news.xml URL
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']['_DEFAULT'] = [ 'fileName' => [ 'defaultToHTMLsuffixOnPrev' => 0, 'acceptHTMLsuffix' => 1, 'index' => [ 'sitemap_news.xml' => [ 'keyValues' => [ 'type' => 1451160842, ] ] ] ] ];
使用RealURL的网站地图的说话式URL
如果说话式URL在网站地图中不应工作,则必须在typoscript中包含以下内容
为页类型1449874941启用
[globalVar = TSFE:type = 1449874941] config.tx_realurl_enable = 1 [global]