Copied to clipboard

Flag this post as spam?

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


  • Nekesh 13 posts 103 karma points
    Jun 02, 2016 @ 12:03
    Nekesh
    0

    Accessing children of a node to level 1

    I want access all descendant of current node using server side.

    I tried Umbraco.ContentQuery.Search("Corporate") which gives all the children whether it is in level 1 or 4.

    Can anybody help me.

  • Alex Skrypnyk 6150 posts 24110 karma points MVP 8x admin c-trib
    Jul 03, 2016 @ 10:55
    Alex Skrypnyk
    0

    Hi Nekesh,

    It's pretty easy task.

    Look at documentation, there are a lot of methods - https://our.umbraco.org/documentation/reference/templating/mvc/querying

    I think you have to use this:

    Umbraco.AssignedContentItem.Descendants("nodeTypeAlias");
    

    Thanks,

    Alex

  • Samira 113 posts 452 karma points
    Jul 06, 2016 @ 07:23
    Samira
    0

    Hi Nekesh,

    Use can try this

    @foreach(var page in  CurrentPage.AncestorOrSelf(1).Children)
    
Please Sign in or register to post replies

Write your reply to:

Draft