Virtual Happy Hour this month, Jun 28, we'll be getting a sneak preview at our soon to launch SaaS CMS!

Try our conversational search powered by Generative AI!

Change of Pagetype template causes no return pages when using FindPagesWithCriteria by filter criteria.Name = "PageCategory"


EPiServer 4.61 with ASP.Net 2.0

I've successfully made an asp:Repeater with datasource made with following code:

PropertyCriteria criteria = new PropertyCriteria();
criteria.Type = PropertyDataType.Category;
criteria.Name = "PageCategory";
criteria.Value = categories; //string with category name
criteria.Condition = EPiServer.Filters.CompareCondition.Equal;

PropertyCriteriaCollection col = new PropertyCriteriaCollection();

children = Global.EPDataFactory.FindPagesWithCriteria(sideContainer, col);

This is working perfectly. However when we change template file (.aspx) of a pagetype it fails. My case is with Ordinary Web page:

  1. Ordinary Web Page has template "Page.aspx"
  2. In admin mode I created new category "TestCat"
  3. I published a new Ordinary Web Page "Test page" and ticked on "TestCat"
  4. I published a page "Listing page" with the listing repeater in it and specified the grand parent of the "Test page" as listing source.
  5. In "Listing page" I could now see my "Test page" in the listing. So far so good!
  6. Now I changed Ordinary Web Page to use template "Standard.aspx".
  7. The page "Test page" is now no longer listed on the "Listing page. NB: I'm only filtering sites by category, not by pagetype or any other criteria!
  8. I've tried changing Ordinary Web Page template back to "Page.aspx" without any luck.
  9. I've also tried untiching and reticking the "TestCat" for my "Test  page" without any effect.
  10. The onlyfix seem to be to publish a new page or export and import it.
My questions are also: Is this supposed to happen? Can I avoid this issue by changing template file first then adding the category and ticking it on afterwards? I know that the last one works, but should I expect it to always work, or will my bug return?


Apr 14, 2008 12:58

The error occured after followin sequence:

1. I created couple of Categories for purpose of filtering pages by category later on

2. I than published some Ordinary Pages and marked them with a certain category.

3. At this point I converted Ordinary Page, XForm, and News by linking them with my newly created Standardpage.aspx. This was done so that already published pages would have same possibilities as Standard page without need of republish.

4. I then copied all of the page properties between the converted page types and added couple of others used by Standard page.

5. One of the newly added properties is a Page link that uses FindPagesWithCriteria to list out all of the pages with certain criteria (here category) under a specified page.

It's at bullet 5 that averything goes wrong. EPiServer returnes 0 pages when filtering on the categories created under bullet 1.

It seems that some kind of "weird" logic behind the curtain no longer aknowledges categories prior to conversion under bullet 3. A workaround is to delete and then create all of the categories prior to conversion.

Edited, May 02, 2008 8:17
* 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.