iCal feed for Athletics events

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

I am writing a module to create a custom iCal feed from a non-calendar content type. The calendar iCal feed view only attaches to calendar views. To simplify the process, I plan to use existing Calendar and Date functions to format my custom iCal feed, for example function template_preprocess_calendar_view_ical(&$vars). However, I don't have a good enough understanding of theme functions to know how to format $vars for the above function or even how to render content through the calendar_ical module theme.

Here is our athletics schedules page: http://www.catlin.edu/athletics/schedules

Can you provide me with advice on how to line up the relevant functions to make this happen? Thank you!

Comments

for a non-code approach

btopro's picture

If you want to do it w.o. code I'd use Feeds and Views Bonus Pack to push that non calender data into event based nodes. This way you can mash it up with other calendar based content as well as allow people to use 1 view to filter out the items that they want in an ical feed. Then you could just filter it to display only the items in athletics and provide a hard link to that on this page. From the code side I'm unsure but usually when there's data I want to render out in a certain way I try to stick to modules that accomplish the same thing and modify my workflow a bit to get data where it should be. Much less of a pain point to upgrade in the future as well when you're on Drupal 110 with different APIs then Drupal 6/7 :p

Thank you for the comment.

kassissieh's picture

Thank you for the comment. That's great, but how to you make an iCal feed out of a non-calendar content type? I actually have an event-based content type, the calendar_ical module won't attach to a view of that content type.

bonobo's picture

Hello, Richard,

What is the data structure of the nodes you are attempting to stuff into your feed?

What exactly do you mean when you say "non-calendar content type"?

If you provide the data structure that you are attempting to format, it could be possible to sort out a viable direction here, but without the data structure and a description of the goal you are trying to achieve (ie, what types of events are getting exposed via this feed, and why does your use case require a non-standard approach) it's hard to give accurate feedback.

From what you are describing ("I actually have an event-based content type") it sounds like you have a views config issue, or that you have taken a non-standard approach to handling datetime.

But, there isn't a lot of detail here, so either of my assumptions could be off.

Cheers,

Bill

Modules

kassissieh's picture

https://drupal.org/project/date

https://drupal.org/project/cck

https://drupal.org/project/calendar (includes calendar_ical)

I use calendar_ical to deliver iCal feeds for calendar content types. It does not support non-calendar content types.

I have defined an "athletics" content type and added a date field to it. I need to produce an iCal feed of the content in that date field, ideally from an admin interface-configured view.

Are you still there?

kassissieh's picture

Any thoughts on my recent comment?

Date Tools might do the trick

jpamental's picture

Hi Richard,

You might want to try enabling Date Tools (part of Date module) and using it to create a new calendar view with a new, different content type. This will create a full calendar view including the iCal feed. Test it out and then switch over from one content type to the one you need the feed for - then you can simply reference the iCal feed only, and ignore the rest of the calendar view you created if you don't want to display those events in a grid like that. Let me know if I'm not making enough sense - I'm at DrupalCon this week and have had far too little sleep but didn't want to leave this one unanswered. I've been working with this stuff quite a bit lately and that's worked well for me.

Cheers,

Jason

Jason Pamental
[ @jpamental ]

Exactly

kassissieh's picture

Jason, thank you for the reply. I did not know about that feature, and it sounds like it can work! I may even be able to migrate my current athletics schedule views into this new date-enabled view.

Great! Let me know how it goes!

jpamental's picture

It can be finicky, but I've had some good luck with it. The trick is to alter as little as possible in that new view with regard to the iCal feed, and alter as few of the defaults as possible when initially setting it up. That seems to get the best results.

Cheers-

Jason

ps - we've been working a lot lately incorporating responsive design in our theming - and that might be a really good way for you to address your mobile needs rather than any kind of device detection or theme switching. We'd be happy to share what we've learned on the way.

Jason Pamental
[ @jpamental ]

Responsive theming

bonobo's picture

We recently released Terrain, a responsive base starter theme. We have a few projects that require this functionality, as we'll be building on this in the future.

See http://funnymonkey.com/terrain for a writeup, or just go to http://drupal.org/project/terrain and grab the theme.

Cheers,

Bill

That's awesome!

jpamental's picture

Cool stuff. The one I've done is based on Zen as the base theme and incorporates a ton of LESS.css. Have you played around with that yet? It made figuring all the math for the fluid grid much simpler. I'll send along links to the two responsive jQuery slideshow plugins I've tried as well when I get home. Both needed some help to work with jQuery 1.3.2 in D6, but are good and easy-to-integrate options. The updates in jQuery in D7 might even allow for swiping - it works well in one of them with the latest jQuery but not sure if it works in 1.4.x (I think that's as far forward as D7 is going so far).

Jason

Jason Pamental
[ @jpamental ]

Yes, it's working

kassissieh's picture

Jason,

Yes, it's very much working. Thanks a million! I cloned the Calendar view and changed the content type in the default view. One key is to use the Date category instead of the Content category when selecting Date fields for arguments and filters.

Richard

Drupal in Education

Group organizers

Group notifications

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

Hot content this week