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
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() {
<span>@parent.Level</span>
}
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
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
Hope that helps
Louis
is working on a reply...