Create a google sitemap with typoscript

Create a google sitemap with typoscript for pages and extensions

Use typoscript to create a sitemap with pages and custom urls from extensions, in this exemple I will include one of my one extensions:
xmlSitemap = PAGE
xmlSitemap {
typeNum = 200
config {
no_cache = 1
disableAllHeaderCode = 1
additionalHeaders = Content-Type: text/xml; charset=utf-8
simulateStaticDocuments = 0
absRefPrefix = http://www.YOUR-URL.com
tx_realurl_enable = 1
}

wrap (
<?xml version=”1.0″ encoding=”UTF-8″?>
<urlset xmlns=”http://www.google.com/schemas/sitemap/0.84&#8243;
xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance&#8221;
xsi:schemaLocation=”http://www.google.com/schemas/sitemap/0.84 http://www.google.com/schemas/sitemap/0.84/sitemap.xsd&#8221;
>|</urlset>
)

10 = HMENU
10 {
special = directory
special.value = 1

1 = TMENU
1 {
expAll = 1
NO {
doNotLinkIt = 1

stdWrap {

cObject = COA
cObject {

wrap = <url>|</url>

10 = TEXT
10 {
typolink {
parameter.field = uid
returnLast = url
}
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
}

/**
* Render extension
*/
20 = CONTENT
20 {
table =  tx_txpremises_premises
select {
pidInList = 8 //– Page/folder ID
}
renderObj = COA
renderObj {
stdWrap.wrap = <url>|</url>
5 = TEXT
5 {
typolink.parameter = 9 //– Singel view page for your extension posts
typolink.additionalParams = &objectId={field:uid} //– Custom links to your extensions pages
typolink.additionalParams.insertData = 1
typolink.returnLast = url
wrap = <loc><![CDATA[|]]></loc> //– wrap URL with CDATA
}
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>
}
}

}

This post is an extensions of http://www.adick.at/2010/06/01/typoscript-xml-sitemap/

Annonser

Kommentera

Fyll i dina uppgifter nedan eller klicka på en ikon för att logga in:

WordPress.com Logo

Du kommenterar med ditt WordPress.com-konto. Logga ut / Ändra )

Twitter-bild

Du kommenterar med ditt Twitter-konto. Logga ut / Ändra )

Facebook-foto

Du kommenterar med ditt Facebook-konto. Logga ut / Ändra )

Google+ photo

Du kommenterar med ditt Google+-konto. Logga ut / Ändra )

Ansluter till %s