Event calendar with popups

After building an event calendar (see this page), you might want a balloon / popup / tooltip to appear when hovering over a date. This tooltip would display the node titles of all events on that date. This is not very straightforward to implement in Drupal. I puzzled for 2 days to get this done.

I have written a module for this to make this process easier. You can find it at http://drupal.org/project/calendar_tooltips. It requires beautytips.

If you would like to know how it works or how to do it manually, read on.

There are many tooltip modules for Drupal out there. I use beautytips. Download it and install it. For Explorer you also need to download excanvas_r3, and unzip it in a new directory excanvas_r3 in the sites/all/modules/beautytips/other_libs directory.

The content of a tooltip (the text appearing on the balloon) can come from:

  1. an HTML element's attribute, by default the title attribute
  2. the content of an HTML element
  3. another (external) HTML document.

We won't be using the first method, because I had trouble including HTML markup in the title attribute of an HTML element. The third method, referring to another HTML document, is cumbersome to implement. I went for the second method. Say, for example, we have a date 25 (like in december 25). Normally the following HTML code is produced:

<div class="month mini-day-on"><a href="...">25</a></div>

The class "mini-day-on" is added when there are events on that date. If there are no events on that date, then the class "mini-day-off" is added.

What we are trying to achieve is placing the following HTML code after the hyperlink "25":

<span style="display:none">Christmas day</span>

The text "Christmas day" will not display on the calendar (because of the "display:none" style), but later on when we are done, it should display on the tooltip when you hover over "25" on the calendar. When there are multiple events on that date, it may be useful to list the events in an unordered list. This will look something like this:

<span style="display:none"><ul><li>Christmas day</li><li>Richie's birthday</li></ul></span>

In order to tell Beautytips where to get the content we need to override the calendar module's calendar-mini.tpl.php. Copy sites/all/modules/calendar/theme/calendar-mini.tpl.php to your theme's directory. Add the following code at the beginnning of the month-view div:

<?php
   $bt_options['mini-calendar'] = array(
      "area" => ".mini-day-on a",
      "contentSelector" => '$(this).next().html()'
   );
   beautytips_add_beautytips($bt_options);
?>

The area is a CSS selector that selects every hyperlink (eg. every date) on the mini calendar. The contentSelector is jQuery code which specifies the HTML code  of the hyperlink's first sibling (in our case the span element) as the tooltip's content.

Now we need to write some PHP code that produces the span element with the relevant event data. This is the difficult part. Look for the function called template_preprocess_calendar_datebox in sites/all/modules/calendar/theme/theme.inc. Copy this function to your theme's template.php. Replace the text "template" by the name of your theme. Insert the following code after this line:

$vars['class'] = 'mini-day-on';

Here is the code:

$bt_text = "<ul>";
foreach ($vars['items'][$date] as $time => $results_at_that_time)
   foreach ($results_at_that_time as $num => $result)
      $bt_text .= "<li>" . $result->raw->node_title . "</li>";
$bt_text .= "</ul>";
$bt_text = "<span style=\"display:none\">" . $bt_text . "</span>";
$vars['link'] = l($vars['day'], $vars['url']) . $bt_text;

What this does is aggregating all event data of that day and put it in an HTML unordered list, which is parented in a span element, which, on its turn, is placed next to the hyperlink.

That's it!

think the combination of lots

think the combination of lots of bright colors and accents made the kids line super marketable. The sundresses for kids were perfect. Like the bikini's they came in all the shades of the rainbow.Obat Kutil Kelamin De Nature Asli, Ampuh, dan Tradisional I loved the tassel details on the dresses and on the ties for the bikinis. If I need a birthday gift for little girl, I am going to purchase one of those sundresses, they were too cute Obat Hepatitis B Terbaru, Paling Ampuh, dan Tradisional

wish great. and having fun

wish great. and having fun I've gone down the path of tracking down Obat Hepatitis B Paling Ampuh as much expired slide film as I can get my hands on. Obat Hepatitis B TradisionalUsually buying film after its expiry date means you can get it for half price or less... and usually without being able to notice any difference between it and non-expired film since you're essentially using Obat Radang Lambung dan Maag Lambung Paling Ampuh hink the combination of lots of bright colors and accents made the kids line super marketable. The sundresses for kids were perfect. Like the bikini's they came in all the shades of the rainbow.Obat Hepatitis B Terbaru think the combination of lots of bright colors and accents made the kids line super marketable. The sundresses for kids were perfect. Like the bikini's they came

epilepsi

Diseases Epilepsy is a chronic neurological disease that causes seizures periodically. Seizures will occur when the electrical impulses in the brain blast past the normal limit. Obat Epilepsi Anak

Obat Kolesterol Di Apotik

thank for information succes one first position google Obat Luka Diabetes Basah Obat Tradisional Penyakit Luka Diabetes obat ejakulasi dini thanks

wasir

Inadequate intake of foods containing fiber, prolonged sitting, heavy lifting or straining during defecation is a factor that can cause hemorrhoid disease. Khasiat daun sirih merah

in all the shades of the

in all the shades of the rainbow.Obat Hepatitis B think the combination of lots of bright colors and accents made the kids line super marketable. The sundresses for kids were perfect. Like the bikini's they came in all the shades of the rainbow.Obat Kutil Kelamin De Nature think the combination of lots of bright colors and accents made the kids line super marketable. The sundresses for kids were perfect. Like the bikini's they came in all

the shades of the

the shades of the rainbow.Obat Kutil Kelamin think the combination of lots of bright colors and accents made the kids line super marketable. The sundresses for kids were perfect. Like the bikini's they came in all the shades of the rainbow.Obat Kutil Kelamin Ampuh think the combination of lots of bright colors and accents made the kids line super marketable. The sundresses for kids were perfect. Like the bikini's they came in all the shades of the rainbow.Obat Kutil Kelamin Tradisional think the combination of lots of bright colors and accents made the kids line super marketable.

The sundresses for kids were

The sundresses for kids were perfect. Like the bikini's they came in all the shades of the rainbow.Obat Radang Lambung think the combination of lots of bright colors and accents made the kids line super marketable. The sundresses for kids were perfect. Like the bikini's they came in all the shades of the rainbow.Obat Radang Lambung Paling Ampuh think the combination of lots of bright colors and accents made the kids line super marketable. cara menghilangkan bekas eksim The sundresses for

The sundresses for kids were

The sundresses for kids were perfect. Like the bikini's they came in all the shades of the rainbow.Obat Radang Lambung think the combination of lots of bright colors and accents made the kids line super marketable. The sundresses for kids were perfect. Like the bikini's they came in all the shades of the rainbow.Obat Radang Lambung Paling Ampuh think the combination of lots of bright colors and accents made the kids line super marketable. cara menghilangkan bekas eksim The sundresses for

kids were perfect. Like the

kids were perfect. Like the bikini's they came in all the shades of the rainbow.Obat Maag Lambung think the combination of lots of bright colors and accents made the kids line super marketable. The sundresses for kids were perfect. Like the bikini's they came in all the shades of the rainbow. Obat Maag Lambung Paling Ampuh think the combination of lots of bright colors and accents made the kids line super marketable. The sundresses for kids were perfect. Like the bikini's they came in all the shades of the rainbow.

Obat Aborsi | Obat Penggugur Kandungan | Obat Telat Bulan

Cara menggugurkan kandungan paling baik dan aman dalam dunia kedokteran pasti kita selalu mendapatkan pertanyaan apakah bisa menggugurkan kandungan janin..??Disini kita akan membahas dengan jelas tentang prosedur yang sudah ada. Cara menggugurkan kandungan obat penggugur janin Cara Menggugurkan Kandungan Ampuh Obat Penggugur Kandungan Herbal Obat Aborsi Alami

Obat Aborsi | Obat Penggugur Kandungan | Obat Telat Bulan

Cara menggugurkan kandungan dengan obat penggugur kandungan ini telah memberi tingkat keberhasilan 100% . Bila Anda tinggal di negara yang tidak menyediakan akses pelayanan obat aborsi yang aman dan anda ingin Obat penggugur kandungan dengan obat penggugur janin, Anda bisa memesanya ditempat kami secara online. Kami menjual obat penggugur janin, obat penggugur kandungan, obat aborsi secara online untuk membantu anda dalam hal aborsi sendiri.Kunjungi Situs kami di dokter-obataborsi.com

No Limit for events display on calendar

Hey

 

In this module we could not control how much events we can display on each day ....

Fused Silica - Multi-lab

Fused Silica - Multi-lab offer BNP 2 Machinable Aluminium Nitride in blocks, rods, sheets and finished components for industries including aerospace.

Are you still supporting this?

I'm having an issue making this work. I keep recieving this error and I'm too green with Drupal to figure out how to fix it.

 

  • Notice: Undefined property: stdClass::$raw in zen_preprocess_calendar_datebox() (line 167 of/home/content/37/5923437/html/dev2/sites/all/themes/zen/template.php).
  • Notice: Trying to get property of non-object in zen_preprocess_calendar_datebox() (line 167 of/home/content/37/5923437/html/dev2/sites/all/themes/zen/template.php).
  • Notice: Undefined property: stdClass::$raw in zen_preprocess_calendar_datebox() (line 167 of/home/content/37/5923437/html/dev2/sites/all/themes/zen/template.php).
  • Notice: Trying to get property of non-object in zen_preprocess_calendar_datebox() (line 167 of/home/content/37/5923437/html/dev2/sites/all/themes/zen/template.php).

 

Re: Are you still supporting this?

The instructions on this page are for Drupal 6 users that prefer to do this manually (without using the calendar_tooltips module). If you use the module, then you do not need to edit any files. Also, this page has not been updated for Drupal 7 yet. That's probably why you get those error messages.

So, if you undo the changes you made in the templates then it should work.

Cheers,

Ronald

ambeien

Hemorrhoids or piles known as hemorrhoids,namely the decrease in bearing the anus (anal cushion) which is caused by many things, these bearings consists of mucosa, smooth muscle tissue of the anus, loose connective tissue and vascular tissue.Manfaat Kunyit Untuk Ambeien

obat kolesterol

thank to information Obat Asam Urat Yang Ada Di Apotik succes and Jamu Kuat Pria Tahan Lama first one position

bronkitis pada anak

QNC Jelly Gamat able to treat bronchitis in children is safe and without side effects, QNC jelly gamat give herbal treatment for children suffering from bronchitis.Obat Herbal Bronkitis Pada Anak

Need this module for drupal 5

Hi

I really liked this module but i need this for drupal 5 can you please help me out in this

Regards,

Muhammad

High Fever Treatment

How to cope with fever and body ache with herbal medicine QNC gamat jelly can help heal or cope with chills and body aches naturally and quickly. Pengobatan Demam Tinggi
Bahaya Obesitas
Penyubur Sperma
Penyakit Parkinson
Tips Anak Sehat
Jelly Gamat Cair
Sleep Care Capsule

Re: Need this module for drupal 5