Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
AI OnAI Off
Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
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!