Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Joe 21 posts 41 karma points
    Feb 18, 2011 @ 21:29
    Joe
    0

    Sitemap Not Working With Google Webmaster

    I am not able to get my sitemap in umbraco to cooperate with google webmaster. I submit my sitemap as sitemap.aspx. You can see the error google throws at the bottom of this entry.

    My Sitemap code:

    <?xml version='1.0' encoding='UTF-8'?>
    <xsl:stylesheet
    version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:msxml="urn:schemas-microsoft-com:xslt" xmlns:umbraco.library="urn:umbraco.library" exclude-result-prefixes="msxml
    umbraco.library">

    <xsl:output method="xml" omit-xml-declaration="yes"/>

    <xsl:param name="currentPage"/>

    <!-- update this variable on how deep your site map should be -->
    <xsl:variable name="maxLevelForSitemap" select="4"/>

    <xsl:template match="/">
    <div id="sitemap">
    <xsl:call-template name="drawNodes">
    <xsl:with-param name="parent" select="$currentPage/ancestor-or-self::node [@level=1]"/>
    </xsl:call-template>
    </div>
    </xsl:template>

    <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)">
    <ul><xsl:for-each select="$parent/node [string(./data [@alias='umbracoNaviHide']) != '1' and @level &lt;= $maxLevelForSitemap]">
    <li>
    <a href="{umbraco.library:NiceUrl(@id)}">
    <xsl:value-of select="@nodeName"/></a>
    <xsl:if test="count(./node [string(./data [@alias='umbracoNaviHide']) != '1' and @level &lt;= $maxLevelForSitemap]) &gt; 0">
    <xsl:call-template name="drawNodes">
    <xsl:with-param name="parent" select="."/>
    </xsl:call-template>
    </xsl:if>
    </li>
    </xsl:for-each>
    </ul>
    </xsl:if>
    </xsl:template>
    </xsl:stylesheet>

    The error I get from Google is:

    Sitemap is HTML
    Your Sitemap appears to be an HTML page. Please use a supported sitemap format instead.
    Tag: html
    Problem detected on: Feb 18, 2011
  • Sebastian Dammark 583 posts 1407 karma points
    Feb 18, 2011 @ 21:39
    Sebastian Dammark
    2

    Doesn't Google expect a XML sitemap ?
    Your template above renders a (X)HTML file.

    Maybe you should try this package (Cultiv Search Engine Sitemap)

  • Joe 21 posts 41 karma points
    Feb 18, 2011 @ 21:41
    Joe
    0

    Unfortunately, our web server and web maintenance is outsourced, so I don't have the ability to install umbraco packages (at least I don't think). Is there a way to hard code this?

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Feb 18, 2011 @ 21:51
    Jan Skovgaard
    0

    Hi Joe

    It should be possible for you to install the package from the "Developer" section in Umbraco. There is a folder named "Packages" here you can upload a downloaded package and install it. You can also install the package using the package repository.

    Does this make sense? And do you see the "developer" section in Umbraco? If not it's probably because you have restricted priviliges.

    Hope it makes sense.

    /Jan

  • Joe 21 posts 41 karma points
    Feb 18, 2011 @ 22:17
    Joe
    0

    Got it, thanks!!

Please Sign in or register to post replies

Write your reply to:

Draft