different approaches

Author Message

Pierre Bastoul

Monday 14 November 2005 7:41:06 am

Hi,

Can some one help choice the best approach ? Here is what I want to do :

I have made a class named "event" used to store calendar events such as a birthday, a shop opening date, a special discount week, a movie ... those events are of different nature : some are cultural, other are commercials... I would like to show them in different places of a site (I mean in different folders of my content structure), depending of their nature.

what is best :

- create an "events" folder in media. Change my event class to add a "nature" attribute. Create all events in the media/events folder. Then create one overide template of folder.tpl for each nature of event. That template will have to fetch events using a filter attribute.

- create an event folder in media, create all events in it. For each event that I want to see in other places, add new locations.

- create a folder content/calendar. In it create "cultural", "commercial", "cinema", "theatre" folders. Put in them my events. Fetch recursively content/calendar if I want to see all events...

May be there are smartest solutions that I can not imagine.

Gabriel Ambuehl

Monday 14 November 2005 8:55:17 am

Another approach: a differenct event class for each of the event types?

Visit http://triligon.org

Brendan Pike

Monday 14 November 2005 8:23:48 pm

I think it also depends on if you are going to have 20 or 30 events on average or 200 upwards. In my experience if you need to do filtering of a large vlume of content their can be a performance cost. I would probably create seperate folders for each type.

www.dbinformatics.com.au

We are always interested in hearing from experienced eZ PHP programmers and eZ template designers interested in contract work.

Mark Marsiglio

Monday 14 November 2005 8:44:02 pm

I think you will find your 3rd option the best for performance and maintenance.

The recursive fetch is very easy to do, and to categories will allow you to keep fewer items in each folder, which is easier to maintain.

You can place an event in more than one location using the Locations function if it fits in two categories, and when you do your recursive fetch you can filter to keep it from appearing twice.

http://www.thinkcreative.com
Turning Ideas Into Strategic Solutions

Pierre Bastoul

Saturday 19 November 2005 6:22:42 am

so all of you seem to prefer the 3rd approach. Ok, thanks for your comments. I think I will do as you recommend.

Is there a way of adding other locations automaticly ? I mean, when an object is published in one folder, make it visible in one other folder without the need of doing it with the location button ?

Because I will have two trees, one like this :
/leasure/evening/cinema/
and the other one :
/utils/agenda/cinema/

so one event of type "movie" should be published in both folders... and it's better that the publisher does not have to worry about that...

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.