This project is read-only.

Filter by page property value

Topics: Developer Forum
Mar 2, 2008 at 12:13 AM
Edited Mar 2, 2008 at 12:15 AM
Hello, is there a filter by property value? I found examples of TypeFilter.Filter, CountFilter.Filter using. I would like to filter list of pages by a detail (property) value. At the moment I'm iterating (foreach) the items collection (copy of e.Items) and comparing page details with the value and removing undesired pages from the e.Items collection.

I did short source checking of filters in core N2.Collections, of the classes inheriting ItemFilter but didin't found any. Maybe I missed something, but if not, maybe I can contribute.

Mar 2, 2008 at 1:56 AM
Sounds terrific. Can you send a patch?
Mar 2, 2008 at 9:53 PM
Edited Mar 2, 2008 at 10:01 PM
Hi, yes sure. I'll give it a shot and send the code.

Meanwhile I have another thing I don't have idea what could be the reason. I have created a part, and dropping it to the zone works ok. The part is rendered (visible) in public on all pages except the start page (without page name, only url + / ). When I navigate to the same page in Edit, parts are rendered correctly as for all other pages.

So, when part is dropped to it is not rendered on public web. When part is dropped to it is visible.

Part control is .ascx, and the breakpoint doesn't stop on PageLoad only on the start page in public (in edit it does). I guess it is something related to UrlRewriting, because when I hit the page directly with ID like parts are loaded. What to do to get "/" processed for parts? Other details like Text get displayed correctly.

Thanx in advance
Mar 2, 2008 at 11:14 PM
Maybe you are hitting another template than the one you were expecting.

Usually when you request the / directory /default.aspx page will handle that request. N2 only rewrites paths if no aspx exists at the requested url. In this situation N2 wouldn't rewrite the path (maybe it should), even if the item corresponding to that has another template url.
Mar 3, 2008 at 6:30 AM
Yes, thanx boss.

The the page with ID 1 was of a type that uses /Pages/SectionPage.aspx layout but on the / site address the Default.aspx get's loaded. I solved it by copying SectionPage's front code to Default.aspx. Lesson learned.