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
Hello,
I have the following structure:
class BasePage : PageData {}
class A : BasePage {}
class B : BasePage {}
and some other classes who inherit from this BasePage.
Now I need to retreive all the pages based on the BasePage type how can I do that except by queriing the tree recursively?
I have try
var collection = new PropertyCriteriaCollection
{
new PropertyCriteria
{
Required = true,
Name = "PageTypeName",
Condition = CompareCondition.Equal,
Type = PropertyDataType.PageType,
Value = "BasePage"
}
};
var queryService = ServiceLocator.Current.GetInstance<IPageCriteriaQueryService>();
return queryService.FindPagesWithCriteria(ContentReference.RootPage, collection);
But it doesn't seem to work.
Regards,
Benjamin