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 82 posts 94 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 6150 posts 24110 karma points MVP 8x 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 82 posts 94 karma points
    Sep 29, 2016 @ 13:27
    Ken Mark
    0

    Hi

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

  • Alex Skrypnyk 6150 posts 24110 karma points MVP 8x admin c-trib
    Sep 29, 2016 @ 14:54
    Alex Skrypnyk
    0

    Ken, why not?

    You can cat IPublishedContent to ModelBuilder Class.

Please Sign in or register to post replies

Write your reply to:

Draft