Support Question: How can I expose my drupal calendar (block) on a static html site?

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

Hi all,

Hope you don't mind me brainstorming with you but I figured:
1) this has proven to be a collection of bright Drupal heads.
2) i may actually get a response here ... no such luck in the Drupal forums.

Anyway, I'm looking for a way to expose the calendar block (from one site) as a block on a static HTML site.

I'm thinking I might have to write a module that periodically dumps the calendar HTML into a static file that can be included using a server-side include or javascript.

Any one else have a better idea?

Thanks,
Kevin

Comments

that sounds like the best idea

kyle_mathews's picture

Write a module to dump the html sounds like by far the best idea. If the other site were a Drupal site there might be some way of transfering the calender info over via the services module.

Kyle Mathews

Kyle Mathews

other possibilities

webchuck's picture

I think the module that does periodic dumps might not be a bad way to go, but you'll have to worry about stale data, or run cron very frequently. Also, how static is this other site? No php available?

A couple other options:

  • Pure javascript option - Do an AJAX call to the Drupal site hosting the calendar, then use a regular expression to extract the calendar HTML only, and display that HTML. This guarantees that the content will be fresh, but the JS isn't terribly straight-forward.
  • I-Frame option - Create a simple module (or function in template.php) to print the calendar block to the page without the theme, then call that page in an i-frame on your static website.

I don't know that these are any better than the first, but it may be easier than writing to a file on a different server.

  • Chuck

Thanks guys. This gives me

kmillecam-gdo's picture

Thanks guys.

This gives me something to chew on.

I'll probably go the "save HTML to a file" route initially -- knowing that it'll never reflect current information -- and maybe look into the AJAX or iFrame solutions later.

Kevin

Did you get your calendar working?

stompersly's picture

You could also export the calendar using the views I-Cal if you had something to load and display the I-Cal data.
Never tried this with a calendar but we have also done alot of other data with RSS feeds and then use flash to display the data.