Project:Event
Version:6.x-2.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:needs review

Issue Summary

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.

Comments

#1

Status:active» needs review

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 :)

AttachmentSize
event_title.patch 1.03 KB

#2

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!

#3

patch works for 6.x 2.x-dev

#4

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.

#5

What if we put limit like this:

<?php
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'];
  }
}
?>

#6

Category:support request» feature request