Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By Chris_Allen on
Hi,
I'm using the event module to show a calendar and list of upcoming events and would like the events to remove themselves from the Upcoming Events list once the day is finished. e.g On 26th Dec the Christmas Day event is automatically removed.
Once they've expired we need them to go into a "Past Events" section/list.
I've looked around at various posts and the closest one is this http://drupal.org/node/77166 which expires the events by changing their date. This would be OK but it will mess up the Past Events section.
Anyone got any ideas how I can do this?
Thanks
Chris
Comments
Snippet for a simple upcoming/previous events page using CCK
Hi Chris,
Here's 2 simple page snippets that pulls up a CCK content type for upcoming/previous events.
Notes:
-------
a) this has been tested with the latest Drupal 4.7.4 and the latest cck.module (for version 4.7)
b) the snippet lists node teasers sorted by a date field and only those with a date after today's date (upcoming events).
Previous (cck) Events snippet
Upcoming Events version of the same snippet
Same as above, except it lists events coming up after todays date
hope that helps
Dub
Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate
Cracked it!
Yes, that's done the trick!
A note to other newbees: I initially got a MySQL error saying it couldn't find the table. It took me a little while to figure out that I needed to retain the "node_" in front of my content type name when replacing the $contentname variable and retain "_value" at the end of the $sortbyfield variable.
Thanks Dub!
updated version using the event module
Hi Chris,
Here's an updated version that uses the EVENT.MODULE date field, instead of a cck.module date field. I
UPCOMING EVENTS SNIPPET.
PREVIOUS EVENTS SNIPPET
hope that helps
Dub
Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate
How would I do this with flexinode?
Drupal 4.7
out of context - your bluebreeze theme issue maybe fixed
Sorry to others. I only want to contact onecreative...
my solution 4u: http://drupal.org/node/109985
Squelle Group, s.r.o. - Drupal web development, consulting and training.