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
    Nov 17, 2023 @ 10:19
    Simeon Ostberg
    0

    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
    Nov 20, 2023 @ 08:30
    Simeon Ostberg
    0

    Hey everyone,

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

    Thank you! Simeon

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies