Fetching all pages of specific pagetype over multiple sites

mh
mh
Vote:
 

Hi!

We are currently using IPageCriteriaQueryService which allows me to fetch all pages of a specific type with FindPagesWithCriteria. My problem is that a pagereference parameter is required and I need to fetch all pages of a specific type regardless of startpage or site (we have multiple sites sharing EPIServer database).

Does anyone have an idea of the best way to achieve this?

/regards

#171242
Nov 03, 2016 14:52
Vote:
 

Check out the ContentModelUsage class :)

List<ContentReference> references = contentModelUsage.ListContentOfContentType(myContentType).Select(x => x.ContentLink.ToReferenceWithoutVersion()).ToList();

or use root page as start for search?

#171247
Edited, Nov 03, 2016 16:29
mh
Vote:
 

@Daniel Ovaska Thanks a bunch!

#171262
Nov 04, 2016 7:46
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.