Copied to clipboard

Flag this post as spam?

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

  • hetaurhet 245 posts 267 karma points
    Feb 25, 2012 @ 05:25

    sitemap appears as XML


    I have installed Cultiv Search Engine Sitemap (Razor edition). I renamed the template to Sitemap and razor to HTMLsitemal.cshtml. this template contains following code.

    <%@ Master Language="C#" MasterPageFile="~/umbraco/masterpages/default.master" AutoEventWireup="true" %>
    <asp:Content ContentPlaceHolderID="ContentPlaceHolderDefault" runat="server">
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "">  
    <umbraco:Macro runat="server" language="cshtml">

    and .cshtml have following code.

    <link rel="stylesheet" type="text/css" media="screen, print" href="/css/slickmap.css" />
    @helper ListChildNodes(dynamic startNode)
        Response.ContentType = "text/xml";
        const int maxLevelForSiteMap = 100;
        foreach (var node in startNode.Children
            .Where("umbracoNaviHide == false")
            if(node.template > 0) {
                    <lastmod>@(string.Format("{0:s}+00:00", node.UpdateDate))</lastmod>
                    @if (node.SearchEngineSitemapChangeFreq.ToString() != "")
                    @if (node.SearchEngineSitemapPriority.ToString() != "")
            if (node.Level <= maxLevelForSiteMap && node.ChildrenAsList.Count > 0)

    @functions {
        private static string GetUrlWithDomainPrefix(string url) {
            if (url.StartsWith("/"))
              url = url.Substring(1);
            var domainPrefix = string.Format("http://{0}/", HttpContext.Current.Request.ServerVariables["HTTP_HOST"]);
            if (url.StartsWith(domainPrefix))
                return url;
                return domainPrefix + url;

    When I make page called sitamap with this template applied and run. It shows XML like content and in the top it shows... This XML file does not appear to have any style information associated with it. The document tree is shown below.

    So, what is the problem?

  • Jan Skovgaard 11264 posts 23591 karma points MVP 8x admin c-trib
    Feb 25, 2012 @ 08:50
    Jan Skovgaard

    Hi Heather

    I suppose you want to have a html based sitemap displayed, right? The package you installed is creating a sitemap specifically for search engines, which is why you get XML returned. XML sitemaps are used to submit to search engies so they can index the the pages on a site.

    If you need a html sitemap I belive you could benefit from using some of the predefined razor snippets or the sitemap xslt snippet in the developer section.

    Hope this helps.


  • hetaurhet 245 posts 267 karma points
    Feb 25, 2012 @ 09:56

    yes, u r right.

Please Sign in or register to post replies

Write your reply to: