Hi! I need to filter pages that are not published and uses PropertyCriteria. As condition I found EPiServer.Filters.FilterPublished that sounded good but I can´t make it work. Some of the code: PropertyCriteria publishCrit = new PropertyCriteria(); publishCrit.Name = "PublishedStatus"; publishCrit.Type = PropertyDataType.Boolean; publishCrit.Condition = EPiServer.Filters.FilterPublished(); publishCrit.Value = true.ToString(); publishCrit.Required = true; criteriaCol.Add(publishCrit); Any suggestions?
Jun 10, 2005 9:03
Have a look at this FAQ article:
Jul 04, 2005 10:25
I nedd to do the same thing as above. But I have to use the boolean property beacuse it is an own defined property.
Jan 13, 2006 9:55
The following works on a "selected/not selected" dynamic property. PropertyCriteria Crit = new PropertyCriteria(); Crit.Type = PropertyDataType.Boolean; Crit.Name = "DynamicPropertyName"; Crit.Value = "true"; Crit.Condition = EPiServer.Filters.CompareCondition.Equal;
Jan 14, 2006 15:09
Thanks for the input. But when I set the value to "false" I can´t get any matches. The property is not a dynamic property. Am I doing something wrong, the only thing i change from your the example below is the value. /Niklas
Jan 16, 2006 11:35
A Boolean property isn't saved in the database so it's hard to filter on a property that is not saved Maybe you can do your own filter that checks if "ourProperty" == null /snive
Jan 16, 2006 12:24
Check the SDK. The FilterRemoveNullValues might work for you. EPiServer.Filters.FilterRemoveNullValues Class /HAXEN
Jan 17, 2006 11:21
* 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.