Drupal - Views Calendar Theme "Page by date" Navigation Title


I was using Views to display a calendar of events. I then attached a date navigation pager to the calendar. By default, the navigation title was coming out looking like this:

Instead I wanted it to look like this:

This was accomplished by adding this to my theme's template.php file:

 * Implements template_preprocess_date_views_pager().
function my_theme_preprocess_date_views_pager(&$vars) {
  $vars['nav_title'] = date('F, Y', strtotime($vars['nav_title']));

Replace "my_theme" with the machine name of your theme, then flush the Theme Registry cache in Drupal. That's it!

Add new comment