I am trying to add tooltip to events. I have tried many suggestions but couldn't applied it because they are for v5. I just want to see the title of the event when I mouse over it. I think this feature will be very essential addition to event. Thanks.

CommentFileSizeAuthor
#1 event_title.patch1.03 KBmustafadur
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mustafadur’s picture

Status: Active » Needs review
FileSize
1.03 KB

After long try&errors I have managed to port 5.x patch to drupal. Enjoy. All credit goes to original author. I wish he could do it and not costs me weeks. Anyway at least I learned something :)

hutch’s picture

I haven't got an event module set up in D6 but have for D5, so I manually inserted the code from the patch, had to change one line

    return l((int)$date['day'], 'event/'. _event_format_url($date) .'/day', array('attributes' => array('title' => $eventlist)) );

to

   return l((int)$date['day'], 'event/'. _event_format_url($date) .'/day', array('title' => $eventlist));

This is due to the change in usage of l() in D6

The patch works fine, nice feature!

jannalexx’s picture

patch works for 6.x 2.x-dev

killes@www.drop.org’s picture

I am not convinced this is a great idea: If you have more than very few events on the same day, you'll get a very long title attribute.

tutumlum’s picture

What if we put limit like this:

function event_render_day_single($date, $view, $types, $terms, $rewrite_parameter = array()) {
  $nodes = event_calendar_data($date, $view, $types, $terms, 'lookup', array(), $rewrite_parameter);
  if (count($nodes)) {
    $eventlist = array();
    foreach ($nodes as $node) {
        $eventlist[] = $node->title;
    }
    $eventlist = implode(" / ", $eventlist);
    if (strlen($eventlist) > 100) {
      $eventlist = substr($eventlist, 0, 100) . ' ...';
    }
    return l((int)$date['day'], 'event/'. _event_format_url($date) .'/day', array('attributes' => array('title' => $eventlist)) );
  }
  else {
    return (int)$date['day'];
  }
}
tutumlum’s picture

Category: support » feature
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.