Copied to clipboard

Flag this post as spam?

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


  • Yoni 49 posts 118 karma points
    Feb 14, 2017 @ 15:20
    Yoni
    0

    Showing XML content on on webpage with Masterpages (for sitemap)

    I am running a multisite instance of Umbraco. Everything is going well, but now I need to create a sitemap.

    I have managed to create the Macro that displays a perfect XML formatted sitemap, but....

    I can't figure out how to to display on the page with the proper headers. Right now it looks like this:

    <!DOCTYPE html>
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head><title></title>
    </head>
    <body>
       <form method="post" action="./sitemap" id="form1">
         <div class="aspNetHidden">
             <input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="faEtomis/pJrnOEH1FjMt3tYgJgnPP8lddqb60IlljFoqaMzmdGrfFsw4WeF9tCiqAa6bpN0obMQKnBNa1OmWHYSPuVgJB8116lnS+3eY95EqMoOpeTPa8jbsUSJXzXx" />
         </div>
         <div>
           <url>
              <loc>https://www.myDomain.com/</loc>;
              <lastmod>2017-02-12T17:41:48+00:00</lastmod>
           </url>
         </div>
         <div class="aspNetHidden">
            <input type="hidden" name="__VIEWSTATEGENERATOR" id="__VIEWSTATEGENERATOR" value="CA0B0334" />
         </div>
    </form>
    </body>
    </html>
    

    Obviously, this is not a properly formatted XML sitemap file.

    My problem is that the umbraco/default.master has to have the base html, head, body tags to allow the ContentPlaceHolder for my template to work.

    What can I do to make this work?

Please Sign in or register to post replies

Write your reply to:

Draft