A critical vulnerability was discovered in React Server Components (Next.js). Our systems remain protected but we advise to update packages to newest version. Learn More.
AI OnAI Off
A critical vulnerability was discovered in React Server Components (Next.js). Our systems remain protected but we advise to update packages to newest version. Learn More.
category.StringCondition is not correct for comparing Categories. I use criteria.Condition = CompareCondition.Equal
My code, which works fine, looks like this:
public static PropertyCriteria GetCategoryCriteria(ArrayList selections)
{
PropertyCriteria criteria = null;
if (selections.Count > 0)
{
criteria = new PropertyCriteria();
criteria.Condition = CompareCondition.Equal;
criteria.Type = PropertyDataType.Category;
criteria.Value = String.Join(",", (String[]) selections.ToArray(typeof(String)));
criteria.Name = "PageCategory";
criteria.Required = true;
}
return criteria;
}
Hope that helps.
Jon
PropertyCriteria category = new PropertyCriteria(); category.Name = "PageCategory"; category.Type = PropertyDataType.Category; category.StringCondition = EPiServer.Filters.StringCompareMethod.Identical; category.Value = "903"; //comma-separated list of ids or names PropertyCriteriaCollection col = new PropertyCriteriaCollection(); col.Add(category); PageDataCollection pdcNews = new PageDataCollection(); pdcNews = Global.EPDataFactory.FindPagesWithCriteria(EPiServer.Global.EPConfig.StartPage, col);/Jonas