Copied to clipboard

Flag this post as spam?

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

  • Simeon Ostberg 123 posts 389 karma points
    17 days ago
    Simeon Ostberg

    IPublishedContent for first child node

    Hi everyone,

    I have a working sitemap, which starts on the root node, but I would need to start it on the first child node.

    This code gives the root node, and I would like to change siteHomePage:

    @inherits Umbraco.Web.Mvc.UmbracoTemplatePage
    @{Layout = null;
        Response.ContentType = "text/xml";
        string blacklistedDocumentTypeList = Model.Content.GetPropertyValue<string>("blacklistedDocumentTypes");
        string[] blackListedDocumentTypes = (!String.IsNullOrEmpty(blacklistedDocumentTypeList)) ? blacklistedDocumentTypeList.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries) : new string[] { };
        int maxSiteMapDepth = Model.Content.HasValue("maxSiteMapDepth") ? Model.Content.GetPropertyValue<int>("maxSiteMapDepth") : int.MaxValue;
        IPublishedContent siteHomePage = Model.Content.Site();

    How would I need to change this to define siteHomePage to be the first child node of documenttype "master"?

    Thanks! Simeon

  • Simeon Ostberg 123 posts 389 karma points
    14 days ago
    Simeon Ostberg

    Hey everyone,

    I would be happy, if anyone would have an idea...

    Thank you! Simeon

Please Sign in or register to post replies

Write your reply to: