I found out that if i commented out urlPrefix it would remove the first "http://domain.com" entry: (seems like NiceUrl returns the full path with prefix?)
<!-- update this variable on how deep your site map should be --> <xsl:variable name="maxLevelForSitemap" select="100"/>
<xsl:template match="/"> <!-- change the mimetype for the current page to xml --> <xsl:value-of select="umbraco.library:ChangeContentType('text/xml')"/>
<xsl:template name="drawNodes"> <xsl:param name="parent"/> <xsl:if test="umbraco.library:IsProtected($parent/@id, $parent/@path) = 0 or (umbraco.library:IsProtected($parent/@id, $parent/@path) = 1 and umbraco.library:IsLoggedOn() = 1) and @level <= $maxLevelForSitemap ">
<xsl:for-each select="$parent/* [@isDoc and string(umbracoNaviHide) != '1'] | $parent/node [string(./data [@alias='umbracoNaviHide']) != '1']"> <!-- If the document does not have a template, nothing is shown in the frontend anyway. So this is not proper content and should not be in the sitemap --> <xsl:if test="@template > 0"> <url> <loc> <!--xsl:value-of select="$urlPrefix" /--> <xsl:value-of select="umbraco.library:NiceUrl(@id)" /> </loc> <lastmod> <xsl:value-of select="umbraco.library:FormatDateTime(@updateDate, 'yyyy-MM-ddTHH:mm:ss+00:00')" /> </lastmod> <xsl:if test="./data [@alias='searchEngineSitemapChangeFreq'] != '' or searchEngineSitemapChangeFreq != ''"> <changefreq> <xsl:value-of select="./data [@alias='searchEngineSitemapChangeFreq'] | searchEngineSitemapChangeFreq" /> </changefreq> </xsl:if> <xsl:if test="./data [@alias='searchEngineSitemapPriority'] != '' or searchEngineSitemapPriority != ''"> <priority> <xsl:value-of select="./data [@alias='searchEngineSitemapPriority'] | searchEngineSitemapPriority" /> </priority> </xsl:if> </url> </xsl:if>
<xsl:if test="(count(./*
[@isDoc and string(umbracoNaviHide) != '1' and @level <=
$maxLevelForSitemap]) > 0) or (count(./node [string(./data
[@alias='umbracoNaviHide']) != '1' and @level <=
$maxLevelForSitemap]) > 0)"> <xsl:call-template name="drawNodes"> <xsl:with-param name="parent" select="."/> </xsl:call-template> </xsl:if>
The reason for the urlPrefix in the macro (I think) is because NiceUrl() normally doesn't output the full URL - but there's a web.config setting for controlling that, so you might find that in your case it's set to output complete URLs?
/Chriztian
- Yep, the schemaLocation attribute actually needs to be like that :-)
Double entries using Cultiv Search Engine Sitemap
Just installed the package "CultivSearchEngineSitemap 2.0.1" on my Umbraco 4.7.1.
But it seems to generate double entries like this:
I found out that if i commented out urlPrefix it would remove the first "http://domain.com" entry:
(seems like NiceUrl returns the full path with prefix?)
But the schemaLocation still have double entry. Any ideas why this is happening?
Here is my sitemap.xslt:
Ops, just noticed that the schemaLocationis indeed isn't a double entry :-)
But it seems like the urlPrefix might be a bug?
Hi MrBilde,
The reason for the urlPrefix in the macro (I think) is because NiceUrl() normally doesn't output the full URL - but there's a web.config setting for controlling that, so you might find that in your case it's set to output complete URLs?
/Chriztian
- Yep, the schemaLocation attribute actually needs to be like that :-)
Hm.. can't recall that I've changed anything in the web.config like that, but it sounds very plausible. Thanks for the help!
is working on a reply...