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.example.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?
Your Sitemap.Master template (or whatever you're using to place the sitemap xml structure on) doesn't have to inherit from anything but the default Umbraco MasterPage, which shouldn't contain any HTML markup whatsoever. For example, a stock standard install of Umbraco has the following /Umbraco/MasterPages/Default.Master:
<%@ Master Language="C#" AutoEventWireup="True" CodeBehind="Default.master.cs" Inherits="Umbraco.Web.UI.Umbraco.Masterpages.Default" %>
<asp:ContentPlaceHolder ID="ContentPlaceHolderDefault" runat="server">
</asp:ContentPlaceHolder>
It's worth noting that if you are indeed using Umbraco 7 (or 6 for that matter), you could create a Template using MVC instead of MasterPages and it would still work.
For a more detailed answer, share your current Sitemap Masterpage template and structure...