| 1 |
The Event Views module makes the event fields available to the Views module,
|
| 2 |
and creates default event views that filter events using a drop-down date selector,
|
| 3 |
the jscalendar selector, or by arguments in the url. Set up a default event view by
|
| 4 |
going to admin/views and select add. Save the default views as-is or make any
|
| 5 |
changes you like.
|
| 6 |
|
| 7 |
The event_views module will automatically be disabled if either the event module or
|
| 8 |
the views module is disabled, since it requires both those modules to work.
|
| 9 |
|
| 10 |
You can change the format of the output. The default views display a list of events,
|
| 11 |
but you can change it to a table or a teaser list in the Page settings. You can also
|
| 12 |
add or remove fields from the view.
|
| 13 |
|
| 14 |
You can filter events in several ways. Use filters to pre-select a date range, expose
|
| 15 |
those filters to allow the viewer to select a date range, or eliminate the filters and
|
| 16 |
give the view year, month, and day arguments to filter the events by the
|
| 17 |
url (i.e. YYYY/MM/DD).
|
| 18 |
|
| 19 |
Arguments can be confusing but are very powerful. You can combine arguments in various
|
| 20 |
ways, like year/month, year/month/day, or year/week. You can also add content type
|
| 21 |
and taxonomy arguments before or after the year/month/day arguments for even more
|
| 22 |
granularity. For each argument you add, you need to select a display. For lower-level
|
| 23 |
arguments, like the year argument in a year/month combination, select the option to
|
| 24 |
provide a summary view. That will display a list of all the months that have events
|
| 25 |
in that year. You can then click on the month to see the events for that month.
|
| 26 |
|
| 27 |
To view a week calendar, create a view with Year and Week arguments, the go to YYYY/WW
|
| 28 |
where WW is the week number (1-53) that you want to see.
|
| 29 |
|
| 30 |
To theme the exposed filters, put the following in your template.php file. Change
|
| 31 |
'phptemplate' to your theme name and make whatever other style changes you want.
|
| 32 |
|
| 33 |
/**
|
| 34 |
* Example to override standard views handling of the exposed filters to mimic event display
|
| 35 |
* This will change the display only for the calendar view types to show the exposed filters
|
| 36 |
* One on top of the other above the calendar instead of side-by-side in a table
|
| 37 |
*/
|
| 38 |
function phptemplate_views_filters($form) {
|
| 39 |
|
| 40 |
$view = $form['view']['#value'];
|
| 41 |
|
| 42 |
// changed display only for event_views page types
|
| 43 |
if (array_key_exists($view->page_type, event_views_view_types())) {
|
| 44 |
|
| 45 |
foreach ($view->exposed_filter as $count => $expose) {
|
| 46 |
$form["filter$count"]['#title'] = $expose['label'];
|
| 47 |
}
|
| 48 |
return form_render($form['q']) . form_render($form);
|
| 49 |
|
| 50 |
// standard views explosed filters display for all other types
|
| 51 |
} else {
|
| 52 |
|
| 53 |
foreach ($view->exposed_filter as $count => $expose) {
|
| 54 |
$row[] = form_render($form["op$count"]) . form_render($form["filter$count"]);
|
| 55 |
$label[] = $expose['label'];
|
| 56 |
}
|
| 57 |
$row[] = form_render($form['submit']);
|
| 58 |
$label[] = ''; // so the column count is the same.
|
| 59 |
return form_render($form['q']) . theme('table', $label, array($row)) . form_render($form);
|
| 60 |
}
|
| 61 |
}
|
| 62 |
|
| 63 |
|
| 64 |
|
| 65 |
|