Copied to clipboard

Flag this post as spam?

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


  • Ken Mark 75 posts 87 karma points
    Sep 29, 2016 @ 10:37
    Ken Mark
    0

    ModelsBuilder on Masterpage

    Hi

    I just started to use ModelsBuilder and got a question.

    How do I ouput inherited properties on the Masterpage template? For example "site name" that I usually have on the Startpage but put it in the Masterpage template.

  • Alex Skrypnyk 5908 posts 22603 karma points MVP 4x admin c-trib
    Sep 29, 2016 @ 12:53
    Alex Skrypnyk
    0

    Hi Ken,

    You can use Umbraco helper for traversing over Umbraco tree. Read more - https://our.umbraco.org/documentation/reference/querying/umbracohelper/

    For example getting typed root node -

    var homeNodeTyped = Umbraco.AssignedContentItem.AncestorsOrSelf().First(x => x.Level == 1) as Site;
    

    Thanks,

    Alex

  • Ken Mark 75 posts 87 karma points
    Sep 29, 2016 @ 13:27
    Ken Mark
    0

    Hi

    Yes, but then it's not strongly typed models anymore

  • Alex Skrypnyk 5908 posts 22603 karma points MVP 4x admin c-trib
    Sep 29, 2016 @ 14:54
    Alex Skrypnyk
    0

    Ken, why not?

    You can cat IPublishedContent to ModelBuilder Class.

  • 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