Copied to clipboard

Flag this post as spam?

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

  • Thomas 41 posts 121 karma points
    Aug 06, 2018 @ 09:43

    How to check the umbraco content page has how many parent/childs?

    How to find the umbraco content page has how many parent (like parent, parent of parent) / child ?

    example some content page has two parent to reach the site root but some content page has three parent to reach the site root. so how to find and follow this? and how to differentiate it

  • Louis Ferreira 69 posts 265 karma points
    Aug 07, 2018 @ 08:23
    Louis Ferreira

    Hi Thomas,

    You could use the


    property which returns a collection of all the current pages parents. To see how far away they are up the tree from the current page, you could check the Level property

    @foreach (IPublishedContent parent in Model.Ancestors() {

    Hope that helps


Please Sign in or register to post replies

Write your reply to: