Copied to clipboard

Flag this post as spam?

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


  • Fredrik Esseen 594 posts 830 karma points
    Nov 28, 2012 @ 18:18
    Fredrik Esseen
    0

    Get node by ID

    Just a simple thing in my 4.11 mvc installation.

    I want to to get a nodes children by specifying the parent node's id.

    Im trying this:

    @{ var menuItems = Model.Content.NodeById(1119).Children.Where(x => x.IsVisible() && x.IsDocumentType("MenuItem") && x.TemplateId > 0 && Umbraco.MemberHasAccess(x.Id, x.Path)); }

     

    But this obviously isnt right. What is the way to do it and are there any good documentations somewhere so I know what possibilities I have?

  • Jeroen Breuer 4861 posts 12138 karma points MVP 3x admin c-trib
    Nov 28, 2012 @ 19:04
    Jeroen Breuer
    0

    The Umbraco Helper has some useful methods: http://our.umbraco.org/documentation/Reference/Mvc/views

    I think you need TypedContent or Content on the helper.

    Jeroen

  • 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