Automatically updating events

Events happening in the community are now at Drupal community events on www.drupal.org.
akanik's picture

I have an predicament; I am creating a series of Exhibit listing pages for an art organization site. These exhibit pages will be "CURRENT", "UPCOMING", and "PAST". Originally, without thinking it through very well, I thought I would create three different content types for these types of content, and then have views display them accordingly. However, upon further consideration, I realized that it would be loads better to have only one content type ("EXHIBITS") that is somehow updated (according to the date field required for each listing) to the appropriate page. i.e. a user could post an exhibit that doesn't start until June 10th on June 3rd, have that image reside in "UPCOMING EXHIBITS" until June 10th when it would automatically be moved to "CURRENT EXHIBITS", and then when June 11th roles around, have the listing move to "PAST EXHIBITS".

Am I asking too much of Drupal? Since I started learning drupal, it has done nothing but amaze me at how complex and diverse it can be, so I thought I would send this issue out there, just to see if anyone knows anything about automated transfers like that.

Thanks so much for listening,
allie

Comments

This should work like a

kristat's picture

This should work like a charm
http://drupal.org/project/node_convert

Krista Trovato
http://pdiwebdesign.com

Lovely

akanik's picture

Oh lovely! Thanks so much!

You want three Views

gregoryshearer's picture

You are correct, three content types will not work. You cannot change a node from one content type to another without something like Node Convert, which likely requires manual intervention.

The approach I would take would be one content type, and three different Views "Page" displays. Assuming you are using a true Date field with ranges, you should be able to set up different filters for each Page display based on that one date field and it will work auto-magically. They will fall off the one list and onto the other without you doing anything.

Future = start date > today
Past = end date < today
Current = start <= today AND end >= today (two filters)

Each View page display has its own path you assign, so you can list them on menus, assign blocks, etc. Remember to sort the upcoming events ascending by date, next upcoming event at the top of the list, scrolling through future events. (Sorry, that's one of my pet peeves.)

I'd also consider a Block type view display so you can feature the next upcoming event on multiple pages. You can really blow this content type out. Add a field to upload a flyer image that you can use in your views! ;)

Sorry to duplicate

marktfrey's picture

Looks like you beat me to 'submit' :).

Drupal really is magic

akanik's picture

Thank you guys so much. I'm super excited to try this out!

Best,
Allie

Date range arguments / filters

marktfrey's picture

I've addressed this problem in the past by creating a series of views with date-range arguments (or filters, which may be more appropriate in this case) to sort the event nodes into the appropriate category. If the events each require a 'from' and a 'to' date, you can set up a series of views filtered on the following:

Past: To date < now
Current: From date <= now && To date>= now
Upcoming: From date > now

The 'updating' takes place automatically, as the view would only gather the items that meet the appropriate criteria, and once the appropriate date had passed, it would meet the criteria of one of the other views. You'd likely want to node-convert all the existing content into the single 'EXHIBIT' type in addition to building these views.

Also, the category (Past/Current/Future) won't live in the node itself unless you add some sort of rule to update a CCK field or Taxonomy value depending on the date, or introduce some logic in preprocess to display the category. This approach merely moves the display of the node from one time-category page to another.

Opinions on the Calendar module

gregoryshearer's picture

On a related topic..
http://drupal.org/project/calendar

We use this module for tracking events for some clients and I really can't decide if I like the approach or not. It does provide the additional "Calendar" output style that lays out the months in a calendar grid, and that seems its best feature, but I think I have just come to dislike the look of the thing in general, too web 1.0ish looking?

This is the type of effect I am talking about. You see this thing everywhereanymore. What about this is screaming bad design?
http://www.towercare.com/upcoming_events

Is anyone using anything superior to this in terms of events listings? How about something that would also manage event Registrations? Something that would allow payments through UberCart would be awesome.

Anyone know of anything like that? Thanks!

Maybe more than you're looking for

marktfrey's picture

but there's been a buzz about COD lately (http://drupal.org/project/cod, http://usecod.com) It's more for conference organizing, but there are some cool grid-schedules and it handles sponsorship, attendee management, and registrations. I haven't used it personally, but it's been used for a bunch of camps/cons. Possibly worth looking into.

Might be worth starting a new discussion to see what turns up.

More on the same....

akanik's picture

@marktfrey and @gregoryshearer,

I've been trying to get this automatically updating events thing to work... however I seem to be running into some sort of field recognition problem. When I attempt to set the filter : Date: Date (node) (Content: Date (field_date_span) <= 'now'), on my Current Events Page, all of the events in my page display disappear (even though there are plenty of Events that satisfy that requirement).

Additionally, when I tried to include only: Date: Date (node) (Content: Date (field_date_span:value2) >= 'now'), which I assumed was the "To date", all of the events display... even ones that do not satisfy the requirement.

I now suspect that (field_date_span) and (field_date_span:value2) do not refer to the things that I think they do... that is the "From date" and "To date". Below I've included the fields and sort criteria I've set (fields and sort criteria are the only things I messed with).

Filter criteria:
Content: Published (Yes) AND
Content: Type (= Exhibit) AND
Date: Date (node) (Content: Date (field_date_span) <= 'now') AND
Date: Date (node) (Content: Date (field_date_span:value2) >= 'now')

Sort criteria
Content: Date (asc)

Any help would be much appreciated!

Note: I am running d7

Back up a little bit

gregoryshearer's picture

Sorry for disappearing for a couple of days there. We have been really slammed.

I have not actually tried this in D7 but I am hoping it should behave pretty much the same way. It sounds like your thinking in terms of the filter logic is correct. Let me make sure that you are using a true "Date" field in your content type. In D6 the "Date" module is required. http://drupal.org/project/date

Further, you should have just one Date field in the "Exhibit" content type. This field should permit (possibly require) "To" dates. You only want to allow one submission value for this field. Specifically, under Content Types, "Edit Exhibit" then "Field Settings" and "Configure" your "Date Span" field. Under "Global Settings" this field should be "Required" (checkbox) leave "Number of values" set to "1" and make the "To Date" either Optional or Required.

What is bothering me most here is where you say:
Date: Date (node) (Content: Date (field_date_span:value2) >= 'now')

I have never seen that "value2" type of value even available in Views. When I configure a content type like I list above, I see options like this in my Views filters:
Content: Date (field_date) - From date
Content: Date (field_date) - To date

A final thought is you want to set up two different filters on that one Date Span field. It looks like that is what your thinking is already though from your previous post.

A final tip that may not apply directly to this specific project, it is perfectly valid to set up a single "Date" field and reuse it across several content types. This makes it easy to sort multiple content types in the same lists. For example we had a client that wanted content types for "News Stories" and "Press Releases" with different fields, but they wanted them to all show up on the same page listing on the site.

If this does not help you get it sorted out I'd likely need to login and see what is up and we can talk privately about that.

I was having the same issue

akanik's picture

I was having the same issue with the date values. I've been reading a lot about drupal and how to make the things that I want to work, work... but most of the info I find is from d6, which is fine and ususally doesn't present any problems.... but I can't seem to find much information about whether the date field labels have changed from "To date" to ":value2". There are also two other date field options ":delta" and ":rrule". From what info I could find, delta is "the index of the multiple value within the field" and rrule has something to do with the repeating dates option.

Perhaps as a first time Drupal user I should have stuck with d6, but I just got so excited for d7 that I couldn't resist.

Anywho, it sounds like according to your criteria I have set up a true date field. I even created a different field that required the "To date", instead of just having it optional... that didn't work either.

As for logining in to view my content (which is what you meant by login?) I am currently developing only on a local testing server so you wouldn't be able to access that.... At this point, I kind of have a feeling that it might just be issues within the modules. I spent all of yesterday trying to figure this thing out, and I finally realized that I could compare my Current Exhibits view to the already created Calendar Upcoming view because it should be essentially the same (the greaterthan/less than argument would be different of course). But the Calendar Upcoming view wasn't working either.... (although the Calendar Page view is).

Once I figure out what is going on I will post it here. But thanks so much for all of your help. And if you happen upon any info you think might apply to my case feel free to shoot it this way.

Thanks again,
Allie

Thanks Mark!

gregoryshearer's picture

Sorry I do read/post here often enough but I wanted to say that this does look very promising, and yes, we are looking for a complete solution like this.

Since COD is a whole profile/distribution it might be a while before I can get a sandbox in place to really try it out, but I will start a discussion once I have looked at it more closely.

Thanks again!
-Greg

Pittsburgh

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: