I have a Content Type "Event". Each event has a date.

I want

  1. a list of all past events
  2. a list of all future events (most of the time it will be only one)

I think Views would be the way to go.
But how can I tell Views, that when the date come about, the formerly "future event" is now a "past event"?

So, after a cron run, all "future events" shall automatically be "past events", if the date of the event is < than the current date.

Comments

nevets’s picture

If that is a CCK date field there is a views filter for dates.

no2e’s picture

For others searching for the same:

1.) Filters (Add) -> Groups: Date -> select it (in my example: "Date: Date") -> Add
2.) Now you can set some general settings (don't know any details) and under "Date field(s):" you select your event date field. -> Update
3.) Now, don't provide an "Absolute value", but insert now into the "Date default:" field and select "Is less than" (for future events) respectively "Is greater than or equal to" (for past events)

How to insert these Views?

Someone knows, what would be the best/elegent (and in particular optimum performance) way to insert these Views into a real node?
Use Views standard display "block", or use viewfield or use insert_view? Or something else?

Marko B’s picture

nice suggestion, think it should be greater or equal for future and not for past :)

eusebius’s picture

Check out the Composite Layout module. You can make blocks out of your views and then us that module to attach the blocks to your node.

TribalMan’s picture

Our howto here helped me out. I was wondering if you might have a solution to limiting the View to only displaying one future event. I tried to ad "now +day" to the default to field. But naturally this won't work.