Don't miss out Virtual Happy Hour this Friday (April 26).
Try our conversational search powered by Generative AI!
AI OnAI Off
Don't miss out Virtual Happy Hour this Friday (April 26).
Hi,
We are having an extension method to fetch a parent:
public static PageData GetParent(this PageData page)
{
DataFactory.Instance.GetPage(page.ParentLink);
}
(This is for EPi 6, for EPi 7, it's slightly different)
Perhaps I misunderstood you, let me know if this is not what you are looking for.
Okey, thank you! I found the same solution (without method) a while ago:
PageData oPage = null;
oPage = DataFactory.Instance.GetPage(CurrentPage.ParentLink);
or a more secure one:
PageData oPage = null;
if (CurrentPage.ParentLink != EPiServer.Core.PageReference.EmptyReference)
{
oPage = DataFactory.Instance.GetPage(CurrentPage.ParentLink);
}
What is the best/simpliest method if you want to retrieve a pageproperty from a parent page (without specifying page id)? Thankful for help!