I am using WCMUtils.getInheritedProperty to get an inherited page property.
Is there a way to get the page level of which that property is being inherited from?
Thank you.
Solved! Go to Solution.
Views
Replies
Total Likes
Not through the WCMUtils API - if you needed that implementation you'd have to write your own inheritance logic that not only walks up the tree and gets the property value, but also returns the level. It wouldn't be the complicated - you'd have the same inputs as the WCMUtils method, but instead of returning a String you'd return some sort of object that contained both the String and the level, or perhaps the String and the Page object.
Views
Replies
Total Likes
Not through the WCMUtils API - if you needed that implementation you'd have to write your own inheritance logic that not only walks up the tree and gets the property value, but also returns the level. It wouldn't be the complicated - you'd have the same inputs as the WCMUtils method, but instead of returning a String you'd return some sort of object that contained both the String and the level, or perhaps the String and the Page object.
Views
Replies
Total Likes
One way to get a page level is to use the http://dev.day.com/docs/en/cq/current/javadoc/com/day/cq/wcm/api/Page.html API.
Look at this method:
int getDepth()
getParent()
calls would be needed to reach the root node.
Views
Likes
Replies
Views
Likes
Replies