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
Try using FindAllPagesWithCriteria instead of FindPagesWithCriteria
FYI - FindPagesWithCriteria returns all matching pages that the current user has read access for, whereas FindAllPagesWithCriteria returns all pages regardless of permissions.
Something like this?
var contentTypeRepository = ServiceLocator.Current.GetInstance<IContentTypeRepository>();
var contentModelUsage = ServiceLocator.Current.GetInstance<IContentModelUsage>();
var contentType = contentTypeRepository.Load<ArticlePage>();
var allArticlePages = contentModelUsage.ListContentOfContentType(contentType);
I want to get all pages with type of ArticlePage from a controller of a partial.
Currently I have this code and pages is null?