I'm having problems with EPiServer 7 trying to list childrens to a pagetype.
What I want is to get a page reference for the current page. I tried using PageReference listRoot = CurrentPage but it does not work.
My code looks like this:
private IEnumerable<PageData> getChildren(EducationPage CurrentPage)
{
IEnumerable<PageData> pages = new List<PageData>();
PageReference listRoot = CurrentPage;
pages = contentLoader.GetChildren<PageData>(listRoot).OfType<PageData>();
return pages;
}
I believe you need the CurrentPage.PageLink property:
PageReference listRoot = CurrentPage.PageLink;