Don't miss out Virtual Happy Hour this Friday (April 26).

Try our conversational search powered by Generative AI!

PageCriteriaQueryService.FindPagesWithCriteria to find Pages that are shortcuts/fetch data


Is it possible to do an IPageCriteriaQueryService.FindPagesWithCriteria to find pages whos LinkType is a shortcut or Fetch Data ?

Here is what I am trying but with no success.

var criterias = new PropertyCriteriaCollection();

            criterias.Add(new PropertyCriteria()
                Condition = EPiServer.Filters.CompareCondition.Equal,
                Name = "LinkType",
                Type = PropertyDataType.Number,
                Value = ((int)PageShortcutType.FetchData).ToString(),
                Required = true

            var pages = pageCriteriaQueryService.FindPagesWithCriteria(rootPage.PageLink, criterias);

Any help appreciated.


Oct 29, 2014 16:22

Try to set the name of the property to "PageShortcutType".

Oct 29, 2014 16:30

Excellent, that worked! Thanks!

But how ?

I can see the Property named LinkType has a type of EPiServer.Core.PageShortcutType.

I have searched before based on PageTypeID which is the Name of the property not its type ?

Is there some resources that explain how to use the IPageCriteriaQueryService more efficiently ?

Also I can't see how to mark the reply at the "answer" ?

Oct 29, 2014 16:55

IPageCriteriaQueryService is using the "old" untyped way of handling data, that means it operates on the backing PropertyDataCollection rather than the typed model (the c# class). And the property PageData.LinkType is backed in a property named "PageShortCutType". If you use EPiServer Find then you can do queries with your typed model.

If you attach a debugger and look at a PageData instance you can see that it has a property named "Property" of type PropertyDataCollection, there you can see all the properties and the name of the backing PropertyData instance.

Oct 29, 2014 17:03


Thanks for your help.

Oct 29, 2014 17:04
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.