Created
July 30, 2018 14:36
-
-
Save fabtho/837c4424da9d5ce28ae609173426d46f to your computer and use it in GitHub Desktop.
This generates as sitemap.xml for TYPO3 only with Typsoscript. This example is with realurl and news. (tx_news) . Tested in TYPO3 8 LTS. Use "Sitemap: https://www.example.com/?type=200" in robots.txt to point to it.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
User-Agent: * | |
Disallow: | |
Sitemap: https://www.example.ch/?type=200 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Thanks & Credit for this to http://www.adick.at/2010/06/01/typoscript-xml-sitemap/ | |
# write paht to sitemap in robots.txt as "Sitemap: https://www.example.com/?type=200" | |
xmlSitemap = PAGE | |
xmlSitemap { | |
typeNum = 200 | |
config { | |
no_cache = 1 | |
disableAllHeaderCode = 1 | |
additionalHeaders.10.header = Content-Type: text/xml; charset=utf-8 | |
simulateStaticDocuments = 0 | |
tx_realurl_enable = 1 | |
} | |
10 = COA | |
10 { | |
wrap ( | |
<?xml version="1.0" encoding="UTF-8"?> | |
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">|</urlset> | |
) | |
10 = HMENU | |
10 { | |
special = directory | |
#Ausgangspunkt / Root Seite | |
special.value = 1 | |
#1 = Standard | |
#2 = Extended | |
#3 = Extern URL | |
#4 = Shortcut | |
#5 = Not in Menu | |
#6 = Backend User Bereich | |
#7 = Mounted Page | |
#199 = br | |
#254 = Sysfolder | |
#255 = Recycler | |
excludeDoktypes = 2,3,5,6,7,199,254,255 | |
1 = TMENU | |
1 { | |
expAll = 1 | |
NO { | |
doNotLinkIt = 1 | |
stdWrap { | |
cObject = COA | |
cObject { | |
wrap = <url>|</url> | |
10 = TEXT | |
10 { | |
typolink { | |
parameter.field = uid | |
returnLast = url | |
forceAbsoluteUrl = 1 | |
} | |
wrap = <loc>|</loc> | |
} | |
20 = TEXT | |
20 { | |
field = SYS_LASTCHANGED | |
strftime = %Y-%m-%dT%H:%M:%SZ | |
wrap = <lastmod>|</lastmod> | |
} | |
30 = TEXT | |
30.value = <priority>1.0</priority> | |
if.isFalse.field = shortcut | |
} | |
} | |
} | |
} | |
2 < .1 | |
2.NO.stdWrap.cObject.30.value = <priority>0.9</priority> | |
3 < .1 | |
3.NO.stdWrap.cObject.30.value = <priority>0.8</priority> | |
4 < .1 | |
4.NO.stdWrap.cObject.30.value = <priority>0.7</priority> | |
5 < .1 | |
5.NO.stdWrap.cObject.30.value = <priority>0.6</priority> | |
6 < .1 | |
6.NO.stdWrap.cObject.30.value = <priority>0.5</priority> | |
7 < .6 | |
8 < .6 | |
9 < .6 | |
10 < .6 | |
} | |
# and news records... | |
20 = CONTENT | |
20 { | |
table = tx_news_domain_model_news | |
select { | |
//orderBy = title ASC | |
languageField = sys_language_uid | |
pidInList = 110 | |
} | |
renderObj = COA | |
renderObj { | |
stdWrap.wrap = <url>|</url> | |
5 = TEXT | |
5 { | |
typolink.parameter = 112 | |
typolink.additionalParams = &tx_news_pi1[news]={field:uid} | |
typolink.additionalParams.insertData = 1 | |
typolink.returnLast = url | |
typolink.forceAbsoluteUrl = 1 | |
wrap = <loc>|</loc> | |
} | |
10 = TEXT | |
10 { | |
field = tstamp | |
strftime = %Y-%m-%dT%H:%M:%SZ | |
wrap = <lastmod>|</lastmod> | |
} | |
20 = TEXT | |
20.value = <priority>0.7</priority><changefreq>weekly</changefreq> | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment