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();
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?
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