Try our conversational search powered by Generative AI!

Pageprovider FindPagesWithCriteria by Pagetype



we're using page providers to store data migrated from another system in EPiServer.  I'm trying to execute a FindPagesWithCriteria for a specific pagetype, but don't get any pages back. But if I add an additional propertycriteria with the pagetype criteria the FindPagesWithCriteria works.  Please see my code below.

                    PropertyCriteriaCollection criterias = new PropertyCriteriaCollection();
                    PropertyCriteria includer = new PropertyCriteria();
                    includer.Name = "EPI:MultipleSearch";
                    includer.Value = "*";                   
                    PropertyCriteria propCriteria = new PropertyCriteria();
                    propCriteria = new PropertyCriteria();
                    propCriteria.Name = "PageTypeID";
                    propCriteria.Type = PropertyDataType.PageType;
                    propCriteria.Condition = EPiServer.Filters.CompareCondition.Equal;
                    //propCriteria.Required = true;
                    propCriteria.Value = pageType.ID.ToString();
                    propCriteria = new PropertyCriteria();
                    propCriteria.Name = "CompanyName";
                    propCriteria.Condition = EPiServer.Filters.CompareCondition.Contained;
                    propCriteria.Type = PropertyDataType.String;
                    propCriteria.Value = "avon";
                    propCriteria.Required = true;

                    PageDataCollection pages = DataFactory.Instance.FindPagesWithCriteria(EPiServer.Core.PageReference.RootPage, criterias);



Oct 23, 2009 18:47

Have a look at the code in your page provider. All the search logic in FindPagesWithCriteria() has to be implemented in the provider itself, so the logic that handles a "PageTypeID" parameter must be missing? 

Oct 23, 2009 19:03
* 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.