views:

30

answers:

2

Hi,

Instead of asking for help when hitting the iceberg, now I can see there are probably several approaches to what I need to achieve, so I am asking for your opinion: what would you do?

I need to create a timeline in Drupal. The timeline has 3 layers: decade (30s, 40s, 50s ...), year and events.

I will be registering several events that happened in a certain year. I will have some 2, 3 or 4 events per year and I don't have an exact date for each one of them. I just need to link those events to a specific year and then link those years to their corresponding decades. Navigation will be from the global (decade) to the specific (event). I will probably use some jQuery for collpsing a decade block that shows or hides the ten years inside it (ten little boxes) When clicking those boxes, users will be taken first to the detailed year page and then to the detailed event page, in case thhey cklick on one of the events.

My approach until now has been:

1) Create an Event Content Type. One of the fields here is the Node reference. This allows me to link an event to its equivalent year. 2) Year content type. This is a simple content type and is referenced by the events. I will just create each year as a node (1930, 1931, 1932, 1933 ...) 3) Use Taxonomy for the decade layer so that each year registered is linked to one of the registered decades (30s, 40s, 50s, 60s, 70s, etc.).

Well, the problem is with presenting this information. It seems tricky and hard to model it with Views. What I thought of was:

1) First approach - query the years and group them by decade. Then I have two options here: 1.1) Link them to their complete year node. Problem: in case I do that, I cannot pull, from the year node, the related events. Because my node reference isn't years pointing to events, but events pointing to nodes. Do you think I should put the node reference in the year content type instead of the event content type? 1.2) I don't know if this is possible: instead of linking to the year node, use AJAX to open a false window on top of the current one displaying year information and its related events. I don't know if this is possible.

2) Second approach - I could create a taxonomy that would look like this: 30s: 1930 | 1931 | 1932 | 1933 | 1934 | ...

40s: 1940 | 1941 | 1942 | 1943 | 1944 | ...

In this case, I would waive the Year content type and link the events straigh to their year and decade. I would probably loose flexibility because Taxonomy only gives me a title and a description field and I could have more with an Year content type

3) Third approach (menu hyerarchy) - I could simply create decade, year nodes under decades (setting the corresponding decade as a parent menu item), and events nodes under years (setting the corresponding year as a parent menu item). I don't want sub sub items to show in the regular menu, but this is a problem I can solve. I could create a very specific menu only for this hierarchy. This would automatically give me breadcrumbs (in case I use a breadcrumbs module), which would be great. But then, how could I show the child pages from a parent node? I mean, how can I show an year's list of events? Use Contemplates? That would probably not work to show the list of child pages. But it occurs to me I could create a view block that gets an argument and shows the nodes linked to the current node...

Anyway, I am sorry if this got too big. I don't expect any detailed answer, but any help will be appreciated. I have done some stuff with Drupal, but this is the first complex structure I need to build. If you know of any blogs that address this kind of structure with several layers, I appreciate the help. Thanks.

+1  A: 

There are probably some subtle details of the problem that you are trying to address, that escape my attention, but if I were you, I would try to keep the presentation layer separated from the rest.

The first question is: why do you need the years to be nodes? Are years going to contain some kind of information per se or will them just be a collection of events? From your question, I understand it is the latter, so I would rule out having years as nodes.

If I got you correctly, the year when the event has happened is the only additional information that you want to store in the DB, while decades are just a way of grouping nodes according to that information, by using some kind of logic (in this case the integer part of year/10).

You can achieve this in two ways, IMO.

  1. By means of a hierarchic taxonomy.
  2. By creating a node type called "event" that has a field "year" in it, and then by organising all the rest with views.

The first option is straightforward [maybe is even what you were describing as option #2]. You do not necessarily lose flexibility as you can present automatically created information at the template level (for example a picture named like the year or the decade to be put in the page) or link human generated one to a given page with views [For example you could have nodes of type "year description" that you tag with the same taxonomy you use for "events", so that when you filter with the taxonomy term (1945) you will get a list of nodes "events" and one node "year description" in your result, and the template / views will take care of using different node types in different way]

The second option is less straightforward but leave you more flesxibility. You have to directly code your own "node_event module" rather than using CCK, describing your fields to views too there. You then would use Views UI just to assemble your pages [nodes by decades, decade menu, filters...]).

I am quite sure that you can also achieve a similar functionality to option #2 by using CCK + Views UI (so, without having to code), but for that kind of help maybe SO isn't the best place to ask, and you should probably ask on some Drupal-related forum instead.

HTH!

mac
+2  A: 

Try http://drupal.org/project/timeline

its got a lot of interesting features. May not meet all your requirements but its a really cool module. I've used it.

Sid NoParrots
Thank you so much for sharing this.
Marcos Buarque