PropertyCriteriaCollection col = new PropertyCriteriaCollection();
PropertyCriteria criteria = new PropertyCriteria();
criteria.Name = "infoOwner";
criteria.IsNull = true;
criteria.Condition = EPiServer.Filters.CompareCondition.Equal;
col.Add(criteria);
PageDataCollection pages = EPiServer.Global.EPDataFactory.FindPagesWithCriteria(Global.EPConfig.RootPage,col);
Regards,
Johan Olofsson
EPiServer AB
those 3 criterea won't work fo an epi property i.e 'PageName' , what's the best way to FPWC and passing it a generic request to ret all pages. in my mind if pagename is there it should return it, then I can filter on my custom needs
FilterCriteria.IsNull = true;
FilterCriteria.Name = "PageName";
what about rather checking that it's not null.. on the epi property pagename
hi,
If you just require a list of the pages, do you need to go through EPi at all?
A piece of T-sql might be a better route to get this information.
Ian
I was working on a similar issue yesterday (before reading this thread) and never got the hang of the workings of IsNull. I ended up getting all pages (by searching for a PageTypeID greater than 0) and looping through/filtering the pages. I suppose you're only doing this once to the performance penalty of such an approach is probably neglible.
Edit: Oh, this is probably even easier by using the DataFactory.Instance.GetDescendents if you are running CMS 5 R2
PropertyCriteriaCollection col = new PropertyCriteriaCollection(); PropertyCriteria criteria = new PropertyCriteria(); criteria.Name = "infoOwner"; criteria.Value = string.Empty; criteria.Condition = EPiServer.Filters.CompareCondition.Equal; col.Add(criteria); PageDataCollection pages = EPiServer.Global.EPDataFactory.FindPagesWithCriteria(Global.EPConfig.RootPage,col);
andPropertyCriteriaCollection col = new PropertyCriteriaCollection(); PropertyCriteria criteria = new PropertyCriteria(); criteria.Name = "infoOwner"; criteria.Value = null; criteria.Condition = EPiServer.Filters.CompareCondition.Equal; col.Add(criteria); PageDataCollection pages = EPiServer.Global.EPDataFactory.FindPagesWithCriteria(Global.EPConfig.RootPage,col);
Both end up with no result. Can anyone help?