Developer forum

Forum » CMS - Standard features » Can item publisher somehow detect what parent page the items come from?

Can item publisher somehow detect what parent page the items come from?

Hans Ravnsfjall
Reply

Hi

I have an item publisher that displays items in a list. The items it selects, comes from two different parent pages/groups. So the items are itembased child pages.

Is it possible somehow for the Item publisher to detect where the items come from (what parent page/group?)

If not, I would suggest making it possible either as default, or by adding an item field for parentid somehow.

 

regards Hans


Replies

 
Nicolai Høeg Pedersen
Reply

Hi Hans

You can see the pageid of the item when rendering it, and you want the parent.

That can be done in Razor:

Dim currentPage As Frontend.Page = Dynamicweb.Frontend.Page.FindPage(123);
Dim parentPage As Frontend.Page = PageView.Current.Page.FindPage(Base.ChkInteger(currentPage.Value("PageParentPageID")));
 
parentPage.ID
parentPage.get_Value("PageMenuText");

 

You must be logged in to post in the forum