You could also use the predefined sitemap XSLT, which is alreday available in the umbraco developer section. Probably one that is similar to the one you refer to in the old wiki.
Then just replace the html elements with the xml elements you need and make a template with the XML prologue <?xml version="1.0" encoding="UTF-8"?> and after that call your macro. Assign the template to a documenttype and create a node in the content section where you choose your XML template.
@Richard: thanks for the recommendation; I saw that too, but I was hoping to make one without an additional package. That is my fall-back.
@dandryane: Thanks, also. I considered unpacking the CWS to reverse-engineer it but that might be costly timewise? Or, perhaps I could do so at that the autoumbraco.darren-ferguson.com site? Checking that out now.
@Jan: Much much thanks -- I think I'll see if I can combine your instructions with what I see at the auto site to make my own
I have copied all the info from the CWS at the autoumbraco site to my site. There are some interesting differences in the xslt files, as if I were qualified to make such a statement.
Anyhow, I have a sitemap.aspx page now, referencing a sitemap document, which references a sitemap template which references a sitemap macro. However I'm not getting a complete sitemap. Here's the source code on a rendered page:
Kyle, my package really only contains an xslt (don't be afraid, it was made lean and mean especially for people who don't like installing "extra stuff"), here's the source, feel free to use it:
<!-- update this variable on how deep your site map should be --> <xsl:variable name="maxLevelForSitemap" select="6"/>
<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)"> <xsl:for-each select="$parent/node [string(./data [@alias='umbracoNaviHide']) != '1' and @level <= $maxLevelForSitemap]">
<!-- 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'] != ''"> <changefreq><xsl:value-of select="./data [@alias='searchEngineSitemapChangeFreq']" /></changefreq> </xsl:if> <xsl:if test="./data [@alias='searchEngineSitemapPriority'] != ''"> <priority><xsl:value-of select="./data [@alias='searchEngineSitemapPriority']" /></priority> </xsl:if> </url> </xsl:if>
I used your package to add a site map. The functionality of the package promises to be very handsome; thanks for your hard work. However, I'm not getting any nodes rendered. Here is the source output from the sitemap node:
Creating a sitemap.xml for my site
I see this page:
Umbraco/Samples and Articles/XSLT
but I need a very basic explanation for creating the root/sitemap.xml file.
Thanks!
Hi,
I've used this Search Engine Package to create sitemaps. You can see how it works by viewing the xslt's
Hope it helps you,
Richard
Also the CWS has sitemap xslt in it which works great
Hi Kyle
You could also use the predefined sitemap XSLT, which is alreday available in the umbraco developer section. Probably one that is similar to the one you refer to in the old wiki.
Then just replace the html elements with the xml elements you need and make a template with the XML prologue <?xml version="1.0" encoding="UTF-8"?> and after that call your macro. Assign the template to a documenttype and create a node in the content section where you choose your XML template.
Hope this gives some inspiration.
/Jan
@Richard: thanks for the recommendation; I saw that too, but I was hoping to make one without an additional package. That is my fall-back.
@dandryane: Thanks, also. I considered unpacking the CWS to reverse-engineer it but that might be costly timewise? Or, perhaps I could do so at that the autoumbraco.darren-ferguson.com site? Checking that out now.
@Jan: Much much thanks -- I think I'll see if I can combine your instructions with what I see at the auto site to make my own
Awesome community -- thanks everyone!
OK, stumbling towards success here.
I have copied all the info from the CWS at the autoumbraco site to my site. There are some interesting differences in the xslt files, as if I were qualified to make such a statement.
Anyhow, I have a sitemap.aspx page now, referencing a sitemap document, which references a sitemap template which references a sitemap macro. However I'm not getting a complete sitemap. Here's the source code on a rendered page:
<?xml version="1.0" encoding="utf-16"?><urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"><url><loc>http://www.correcturl.com/</loc><changefreq>daily</changefreq><lastmod>2009-08-06T14:11:11+00:00</lastmod><priority>1</priority></url></urlset>
I'm using all the same data that is in the CWS site, at least the one at autoumbraco
Thanks!
Do you have a $level variable somewhere you can set to a greater number perhaps?
Kyle, my package really only contains an xslt (don't be afraid, it was made lean and mean especially for people who don't like installing "extra stuff"), here's the source, feel free to use it:
@Jan: There's this line which I guess you're referrng to?:
<xsl:variable name="maxLevelForSitemap" select="6"/>
@Sebastiaan: I copied your xslt into my xslt file; but I get an error:
This page contains the following errors:
Below is a rendering of the page up to the first error.
There are no error messages in my umbraco error log.
Thanks!
One other thing -- the xslt in the autoumbraco CWS site works fine.
Kyle: I was wondering where the error came from, but I realize it's probably Google right?
I put the sitemap macro in a clean template / master page that looks like this, should help (careful if you add extra line breaks, it will not work):
@Sebastiaan;
I used your package to add a site map. The functionality of the package promises to be very handsome; thanks for your hard work. However, I'm not getting any nodes rendered. Here is the source output from the sitemap node:
<?xml version='1.0' encoding='UTF-8'?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
</urlset>
The CultivSearchEngineSitemap node is published as a child from the content root. All other nodes reside in folders, sorted by language, i.e.,
Content:
|
|
|--sitemap.aspx
|--EN (folder)
| |-- pageone
| |-- pagetwo
|--CN (folder)
|--(and so on)
Thanks!
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.