Skip to content

Instantly share code, notes, and snippets.

@christophlehmann
Last active December 8, 2016 19:46
Show Gist options
  • Save christophlehmann/515e7a16ea65db8a0749b2975cbfd9ab to your computer and use it in GitHub Desktop.
Save christophlehmann/515e7a16ea65db8a0749b2975cbfd9ab to your computer and use it in GitHub Desktop.
TYPO3 TypoScript sitemap for news extension
# Sitemap for news
[globalVar = TSFE:type = 1481221329]
config {
disableAllHeaderCode = 1
admPanel = 0
metaCharset = utf-8
additionalHeaders = Content-Type:text/xml;charset=utf-8
disablePrefixComment = 1
}
newssitemap = PAGE
newssitemap {
typeNum = 1481221329
5 = TEXT
5.value (
<?xml version="1.0" encoding="UTF-8"?>
)
10 = COA
10 {
wrap = <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">|</urlset>
10 = CONTENT
10 {
table = tx_news_domain_model_news
select {
pidInList = {$newsStoragePid}
selectFields = uid,tstamp
}
renderObj = COA
renderObj{
wrap = <url>|</url>
10 = TEXT
10 {
typolink {
parameter = {$newsDetailPid}
additionalParams = &tx_news_pi1[controller]=News&tx_news_pi1[action]=detail&tx_news_pi1[news]={field:uid}
additionalParams.insertData = 1
useCacheHash = 1
returnLast = url
forceAbsoluteUrl = 1
}
wrap = <loc>|</loc>
}
20 = TEXT
20 {
field = tstamp
date = Y-m-d
wrap = <lastmod>|</lastmod>
}
30 = TEXT
30.value = <priority>0.5</priority>
}
}
}
}
[global]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment