Forums / Setup & design / Sort and filter problem

Sort and filter problem

Author Message

Daniel Hubbell

Wednesday 17 March 2004 12:20:47 pm

My site has a front page and 3 schools. I have created a custom class called event. The event class has a show_on_frontpage chackbox. I have published events in one school and added locations to other schools and have the show_on_frontpage checkbox checked.

On the front page I want to display all events with the show_on_frontpage checkbox checked. However, I get duplicate events for events that have been added to another location. I am using a content tree fetch from the root node. Code is displayed below.

My question is how can I filter out the duplicate events?

{let event_list=fetch( 'content', 'tree', hash('parent_node_id', 213,
sort_by, array(array('attribute',true(),'event/event_date')),
attribute_filter, array(array( 'event/show_on_frontpage', '=', '1' ) ),
class_filter_type, "include", class_filter_array, array(32)))}

Thanks for any help

Dan Hubbell
Gobles Public Schools

Mahesh Arvind

Wednesday 24 March 2004 2:55:53 am

Hi,

Try giving the ID of the field, which can be found in your class.

Like attribute_filter, array( and,array(339, '=', true() ) )

Thanks & Regards
Mahesh

Daniel Hubbell

Wednesday 24 March 2004 4:15:32 pm

I am not having a problem using 'event/event_date' instead of the attribute ID. That works fine and is much easier to read. My problem is all articles/events published to more then one location and also flagged to be displayed on the frontpage are displayed multiple times (once of each location published) on the frontpage. I want to be able to filter out the duplicate articles/events so each is only displayed once.

This seems to be beyond the capabilities of this forum since I have only had one attempted solution.

Dan

Daniel Hubbell

Thursday 25 March 2004 3:57:41 pm

Now I see this was a bug and fixed in version 3.3.4. So, now I will figure out how to upgrade to a new version without losing all my work.

Dan