Try our conversational search powered by Generative AI!

Pageprovider FindPagesWithCriteria by Pagetype

Vote:
 

Hi,

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 = "*";                   
                    criterias.Add(includer);
                   
                    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();
                                        
                    criterias.Add(propCriteria);
                    
                    /*         
                    propCriteria = new PropertyCriteria();
                    propCriteria.Name = "CompanyName";
                    propCriteria.Condition = EPiServer.Filters.CompareCondition.Contained;
                    propCriteria.Type = PropertyDataType.String;
                    propCriteria.Value = "avon";
                    propCriteria.Required = true;
                    criterias.Add(propCriteria);
                    */

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

Thanks

Danie

#34006
Oct 23, 2009 18:47
Vote:
 

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? 

#34007
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.