Hello! Thanks so much for this module!

(Looked through the issues a bit and found a references to this issue for the 5.x version (http://drupal.org/node/175327).)

I've created a calendar with exposed filters for a school district's website, and would like parents to be able to come to the site and grab an iCal feed that combines events for the school(s) their kids go to, as well as categories the events fall into. I assumed that the iCal feed would just pull the data from the calendar the link was displayed with, but realized that it instead pulls every event (from the current date forward as is specified in the Views iCal settings).

Is this something that is currently possible with Views that I just need to configure properly?

If not, I found something that addresses this, though it was written back in 2009, and thought it might be outdated for the current version. http://kyle.mathews2000.com/blog/2009/10/06/how-create-custom-ical-expor...
He appear to have ultimately created his own module (I think he modified the original Calendar code and created a whole new calendar module, but I would prefer to stick with the original Calendar module if possible).

He overrode the calendar theme function with the following code:

<?php
/*
* Override theme_calendar_ical_icon() so we can override the url produced.
*/
function phptemplate_calendar_ical_icon($url) {
  // Pull out array of Term IDs from the url.
  $search = preg_match_all("/tid\[([0-9])*\]/", $url, $matches);
  $tids = $matches[1];

  // Grab url stem, we'll add the Term ID arguments back in a bit.
  $search = preg_match("/(.*ical\/)20[0-9]{2}-.*/", $url, $url_stem);

  $url = $url_stem[1];

  // Views arguments treat a "+" between arguments as OR.
  // So we're crafting an argument that asks for all events which match one of the
  // term IDs.
  foreach($tids as $tid) {
    $url .= $tid . "+";
  }

  // Trim off extra +
  $url = trim($url, "+");


  if ($image = theme('image', drupal_get_path('module', 'date_api') .'/images/ical16x16.gif', t('Add to calendar'), t('Add to calendar'))) {
    return '<div style="text-align:right"><a href="'. check_url($url) .'" class="ical-icon" title="ical">'. $image .'</a></div>';
  }
}
?>

Will this work with Views 2, and if so, what would be the best way to implement it? Can it simply be copied into my template.php file as is?

(I'm concerned that this alone won't work in my case, as I have 2 exposed filters, and the filter identifiers have been altered in the taxonomy filter configuration in my view.)

Thanks!

Comments

areikiera’s picture

Title: iCal export does not honor exposed filter values » iCal export does not inherit exposed filter values

"Honor" didn't seem like the right word.

Thanks!

areikiera’s picture

Status: Active » Postponed

Realized that this is really 2 issues, so I'm splitting it into 2 other issues. Wasn't sure what the appropriate status should be, so set it for 'postponed'.

Support request regarding workaround: http://drupal.org/node/1109392
Feature request: http://drupal.org/node/1109370

Neslee Canil Pinto’s picture

Status: Postponed » Closed (outdated)

The D6 branch is no longer supported so we're closing this issue. If you think this issue still exists in D7 you can open a new one.