Ajax Calendar Filter Block

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

I've already created an exposed filter block to list nodes based dates found in a calendar view (it's in the mini calendar format). However I'm now trying to get the calendar block to load the content in the node list block via ajax. In other words I don't want the page to reload when a user clicks on a calendar date.

Here is the code I used to connect the two blocks:

/**
* Alters link url in calendar events block in order to filter events at /orderlist
*
* @see template_preprocess_calendar_datebox()
*/
function themexyz_preprocess_calendar_datebox(&$vars) {
$date = $vars['date'];
$view = $vars['view'];
$day_path = calendar_granularity_path($view, 'day');
$vars['url'] = 'orderlist/' . $date;
$vars['link'] = !empty($day_path) ? l($vars['day'], $vars['url']) : $vars['day'];
}

Found on this page: http://drupal.org/node/1250714

AttachmentSize
calendar-filter.png284.24 KB

Comments

Thanks

Renee S's picture

Super, thanks!

Jamaica

Group organizers

Group notifications

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