Using Category To Populate A PageList

Vote:
 
I would like to know how to use a category to effectively filter a list of pages. We are currently trying to achieve this by binding a datasource to a propertycriteria but this is not returning any results. I have been using the following code... Global.EPDataFactory.FindPagesWithCriteria(Global.EPConfig.StartPage, _criterias) And _criterias is set as follows _criterias = New PropertyCriteriaCollection Dim criteria As PropertyCriteria = New PropertyCriteria criteria.Name = “Group Two” criteria.Type = PropertyDataType.Category criteria.Condition = CompareCondition.Equal criteria.Required = True criteria.Value = “How to Guides” _criterias.Add(criteria) So far I have not been able to get any results using this method. Please let me know how to set up criteria to retrieve documents having any given category name set to true.
#12712
Jul 17, 2006 11:39
Vote:
 
I think from memory you need to use the (int) version of the category not the string version, but of course this then needs to be conerted to a string representation of it. Something like this.... Category aCategory = Category.Find("How to Guides"); if (aCategory != null) criteria.Value = aCategory.ID.ToString(); else return ""; // Don't Search or Filter! Hope this sheds some light on your day!
#14775
Jul 18, 2006 8:57
* 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.