Developer forum

Forum » Development » Getting parent node from current page

Getting parent node from current page


Reply
I'm developing a custom module, and need to fetch the parent node from the current node. How is this accomplished?

Replies

 
Nicolai Høeg Pedersen
Reply

Like this?

Dim currentPage As Frontend.Page = PageView.Current.Page
Dim parentPage As Frontend.Page = PageView.Current.Page.FindPage(Base.ChkInteger(currentPage.Value("PageParentPageID")))

 
Reply
 Does this code call the database when called? or is it safe to use recursively?
 
Nicolai Høeg Pedersen
Reply
It does not call the database. It relies on the cache.
 
Reply
 Thanks

 

You must be logged in to post in the forum