Hi all,

It seems I'm not the only one having troubles with calendar. I've been looking into it but I'm still puzzled. Perhaps anyone can point me into the right direction ?

The site consists of several cities where every city (1 page per city) should have their own events-calendar.
On the page all events of all cities should be displayed.

I already made a new view where a list of all city-pages is generated, so people who fill in the calendar-form already can choose to what city the event belongs.

Now ... how can I filter events per city ?

If someone can get me to start, I would be more than grateful !!!!
Thanks in advance for all your kind help.

Comments

gbrussel’s picture

You'll probably want to use the city (name or term ID) as an Argument in this case.

DolbyNR’s picture

I tried to set up an argument, but it doesn't seem to work (probably human error, hehe)...
What I tried :

Each city has got it's own node (content-type : city's)
Each city-node has got a user-friendly url (like $url.be/antwerp)
Each city should only display their own events ("upcoming"-part of the calendar script)

My query :

SELECT node.nid AS nid,
   node.title AS node_title,
   node.changed AS node_changed,
   node.type AS node_type
 FROM node node 
 LEFT JOIN content_type_opendeurdag node_data_field_datum ON node.vid = node_data_field_datum.vid
 WHERE ((node.status <> 0) AND (node.title = '37'))
    AND ((DATE_FORMAT(ADDTIME(STR_TO_DATE(node_data_field_datum.field_datum_value, '%Y-%m-%dT%T'), SEC_TO_TIME(7200)), '%Y-%m-%d') <= '2009-04-23' AND DATE_FORMAT(ADDTIME(STR_TO_DATE(node_data_field_datum.field_datum_value2, '%Y-%m-%dT%T'), SEC_TO_TIME(7200)), '%Y-%m-%d') >= '2009-04-23'))
   ORDER BY node_changed ASC

FYI : some terms are in dutch ...
"opendeurdag" is the content-type for the upcoming events;
"datum" ... is date :)

RESULT : it starts to work (but still not correctly) -> when I query for node 37 (city called Leuven) it displays the correct result for the events in Leuven, but when I visit $url/node/37 or $url/leuven no events are displayed.