It would be nice, if one can select the month view by clicking the month name, as well as selecting the Day by clicking it's number.

Comments

gerhard killesreiter’s picture

other opinions?

Note that you can already achieve this through theming.

HXn’s picture

Version: 6.x-2.x-dev » 5.x-1.0

I'm using 5.x-1.0, but to make the day clickable, I added the following to the template.php file in my theme folder:

/**
* Catch the theme_event_empty_day function, and redirect through the template api
*/
function phptemplate_event_empty_day($year, $month, $day, $view) {
  return _phptemplate_callback('event_empty_day', array('year' => $year, 'month' => $month, 'day' => $day, 'view' => $view));
}

/**
* Catch the theme_event_calendar_date_box function, and redirect through the template api
*/
function phptemplate_event_calendar_date_box($year, $month, $day, $view) {
  return _phptemplate_callback('event_calendar_date_box', array('year' => $year, 'month' => $month, 'day' => $day, 'view' => $view));
}

Then I created template files for both functions in the theme folder:

event_empty_day.tpl.php

switch ($view) {
  case 'month':
      echo '<div class="day"><a href="/event/'. $year .'/'. $month .'/'. $day .'/day/all/all">'. $day .'</a></div>'."\n";
      echo '<div class="event-empty"></div>'."\n";
    break;
  case 'table':
      echo '<div class="day">'. t('%month / %day', array('%month' => $month, '%day' => $day)) .'</div>'."\n";
      echo '<div class="event-empty"></div>'."\n";
    break;
  case 'day':
  case 'list':
   break;
  default:
      echo '<div class="day">'. $day .'</div>'."\n";
      echo '<div class="event-empty"></div>'."\n";
    break;
}

event_calendar_date_box.tpl.php

switch ($view) {
  case 'month':
      echo '<div class="day"><a href="/event/'. $year .'/'. $month .'/'. $day .'/day/all/all">'. $day .'</a></div>'."\n";
    break;
  case 'table':
      echo '<div class="day">'. t('%month / %day', array('%month' => $month, '%day' => $day)) .'</div>'."\n";
    break;
  case 'list':
      $stamp = _event_mktime(0, 0, 0, $month, $day, $year);
      echo '<div class="day">'. t('%weekday %month %day, %year', array('%weekday' => t(format_date($stamp, 'custom', 'l')), '%month' => t(format_date($stamp, 'custom', 'F')), '%day' => $day, '%year' => $year)) .'</div>'."\n";
    break;
  case 'day':
    break;
  default:
      echo '<div class="day">'. $day .'</div>'."\n";
    break;
}
smccabe’s picture

Status: Active » Needs review
StatusFileSize
new834 bytes

Here is a small patch that makes days numbers links to day pages and I'm sure i could provide another small one for months as well. I know you can change this with theming but it seems like a feature that everyone would want and could be standard.

killes@www.drop.org’s picture

Version: 5.x-1.0 » 6.x-2.x-dev
Status: Needs review » Needs work

Can we add new features to the .2 release?

smccabe’s picture

Status: Needs work » Needs review
StatusFileSize
new495 bytes
new479 bytes

here are patches for 5.x-2.x and 6.x-2.x

japerry’s picture

Status: Needs review » Closed (outdated)

Event for Drupal 8 is unrelated to older versions. If an issue similar to this one exists, please open a new issue with the 8.x branch.