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:

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

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!


VGlass est spécialisé dans la lunette utile pour la santé, notamment les lunettes de protection contre les lumières artificielles (entre autre la lumière bleue). ?Elles évitent à vos yeux de se fatiguer devant vos écrans (PC, tél., tablette,...) Nous avons par ailleurs crée les lunettes OphtaFit qui permettent de relaxer et rééduquer la vue et de garder des yeux en bonne santé. vglass.fr


Great write-up, I am a big believer in commenting on blogs to inform the blog writers know that they’ve added something worthwhile to the world wide web!.. Questions to ask your girlfriend

Printing Services Cheap Near You

I at long last discovered extraordinary post here.I will get back here. I just added your blog to my bookmark destinations. thanks.Quality presents is the significant on welcome the guests to visit the website page, that is the thing that this page is giving.Printing Services Cheap Near You

Carpigiani Benelux

Opgericht in 1946 vestigde Carpigiani zich al snel tot marktleider in de productie van machines voor het maken van gastronomisch ijs, beter bekend als de Italiaanse stijl van ijs. In de jaren ’60 en ’70 de cultuur van het Italiaanse ijs verspreidde zich over de hele wereld, waarna het bedrijf ook zijn eerste overzeese vestiging opent. Daarnaast ontwikkelde het een verkoop netwerk met daarin exclusieve dealers, waaronder Ice Concepts Benelux, waarmee het snelle distributie, continuïteit en ondersteuning kan bieden aan de eindgebruiker. Carpigiani Benelux


minecraft skin stealer

It is ideal time to make a few arrangements for the future and the time has come to be cheerful. I've perused this post and on the off chance that I would I be able to want to propose you some intriguing things or recommendations. Maybe you could compose next articles alluding to this article. I need to peruse more things about it! minecraft skin stealer

college plagiarism checker

Introduce me blogging indonesia want to visit on your website and read the contents of article useful for me, if any time please visit our website college plagiarism checker

Yacht Charters

Day Yacht Charter Boat Rentals, Yacht Charters, Boat Rentals, Boats Charter offers a extensive fleet of Yacht Charters and Boat Rentals as well as Mega Yachts. Our company has actively operated in the yacht rentals offering Affordable daily and week long charters Yacht Charters

voyance gratuite

All around the world, the future becomes unclear. Doubts and questions comes in our mind. To see clearly what will happen in your life, you can visit this website of french voyance gratuite, based in Paris, and call the 0892 22 20 33 to benefit of a voyance telephone with a fortune-teller, able to tell you what you need to know and give you the keys of success.

locksmith gloucester

locksmith company covering cheltenham and gloucester. safes, lock outs, Upvc door lock repair and lock replacement. locksmith gloucester

voyance audiotel pas cher

I am really getting a charge out of examining your richly created articles. No doubt you spend an impressive measure of effort and time on your blog. I have bookmarked it and I am reckoning examining new articles. Continue doing marvelous.voyance audiotel pas cher

band hire SoulDesire uk

Soul Desire is an eight piece soul band playing all of the classic soul hits of the 60s and 70s. Available for weddings, parties, corporate events in the south east of England. band hire SoulDesire uk

voyant par telephone

This is additionally a decent post which I truly appreciated perusing. It is few out of every odd day that I have the likelihood to see something like this..voyant par telephone

voyance telephone

A true voyance par telephone can permits you to discover your future through the veil of fate. Astrology, numerology and tarot cards are the tools of your fortune teller. The tradition of divinatory arts is still strong, even in these times. Your voyance telephone is waiting for your call at the 0892 22 20 22. See you.

Pest Control Cyprus Nicosia

Pest Control Cyprus Nicosia by pestcontrolcy.com will professionally super clean your home or work. They will effectively decontaminate your place removing any mice, rats or insects.


This is a decent tip especially to those new to the blogosphere. Basic however exceptionally precise information… Appreciate your sharing this one. An absolute necessity read post!Loģistika

living in laos

I am cheerful to locate your apparent structure for embellishment the post. After a short time you make it basic for me to comprehend and execute the idea. Grateful to you for the post. living in laos


Shop online at Pink Basis to find super cute clothes for Women at discount prices. Find over 8000 styles of shoes in stock and over 5000 dresses most of which sell for under $25. Looking for a new prom dress then check out the formal dress section for amazing gowns under $50. Pinkbasis

AMI Clubwear

AMIClubwear is famous for inventing the word clubwear and specializes in cheap celebrity fashion trends for under $20. Shop the latest and greatest celebrity style clothing for a fraction of the designer cost and twice the quality.AMI Clubwear

Transport company

Hello! This is my first visit to your blog! We are a group of volunteers and new activities in a similar specialty. Blog gave us valuable data to work. You have made a stunning showing with regards to!Transport company

Security Trier

Beim Qualitätsmanagement unserer Produkte legen wir höchste Maßstäbe an und garantieren ein faires Preis-­Leistungs­ Verhältnis. Das Spektrum, der uns möglichen Sicherheitsdienstleistungen ist sehr breit und muss an die persönlichen Bedürfnisse des Auftraggebers angepasst werden.Security Trier

Final Cut Pro X

From the center of the world to your editing station, editors can create brilliant beams of light in their scene with the Times Lights plugin from Brooklyn Effects(TM). Users can drag and drop the filter onto their footage in FCPX. Then, use the control points to customize the source and direction of the beams. Final Cut Pro X

social media marketing

Don’t Panik! is an award-winning, full-service, cleverly-hyphenated marketing agency located in sunny Carlsbad, California. social media marketing


This is exceptionally intriguing substance! I have altogether appreciated perusing your focuses and have arrived at the conclusion that you are ideal about a significant number of them. You are extraordinary. http://www.kay2.ca

pan card for nri

As per the rules laid in 2007 it is now mandatory for NRIs, PIOs, OCIs and foreign nationals who wish to do any sort of financial or investing related transactions in India. pan card for nri

james jack

Hi! This is my first visit to your blog! We are a team of volunteers and new initiatives in the same niche. Blog gave us useful information to work. You have done an amazing job! wireless access point


Truly, this article is really one of the very best in the history of articles. I am a antique ’Article’ collector and I sometimes read some new articles if I find them interesting. And I found this one pretty fascinating and it should go into my collection. Very good work! http://eubookshop.com/

I discovered your this post

I discovered your this post while hunting down data about web journal related exploration ... It's a decent post .. continue posting and overhauling data. found here

james jack

I’m happy I located this blog! From time to time, students want to cognitive the keys of productive literary essays composing. Your first-class knowledge about this good post can become a proper basis for such people. nice one ico

Hoe maak je een banner

Charming point for a blog. I have been chasing the Internet down fun and stumbled upon your webpage. Glorious post. Thankful a ton for sharing your knowledge! It is unprecedented to see that a couple of individuals still put an effort into managing their locales. I'll try to return again honest to goodness soon.Hoe maak je een banner

good money lender in bugis

1st Credit SG Pte Ltd is a license money lender in Bugis, Singapore. Located in 149 Rochor Road #01-07 Fu Lu Shou Complex Singapore 188425, 1st Credit SG Pte Ltd has help many people to get the cash they needed quickly. They are open every day including weekends and provide loans to everyone in Singapore. Contact them at +65 6266 5422 if you have questions for them. good money lender in bugis

ny notary classes online

How to become a New York State Notary Public. Take the New York Notary Public Association online exam prep course and get your NY State Notary license quickly. FREE Notary Public membership for life with class and gain instant RESPECT in your office. Notary Practice exams. ny notary classes online


Hi I found your site by mistake when i was searching yahoo for this acne issue, I must say your site is really helpful I also love the design, its amazing!. I don’t have the time at the moment to fully read your site but I have bookmarked it and also add your RSS feeds. I will be back in a day or two. thanks for a great site. http://swelteringnanny.1apps.com

adoption agencies in texas

We help women learn about the adoption process, other options available for an unplanned pregnancy and do our best to unite them with local resources that can fully facilitate adoptions. adoption agencies in texas

Plantation Shutters

Dolphin Window Shutters offer stylish, yet affordable, custom made interior plantation window shutters for any shaped window in any room of your house Plantation Shutters


So luck to come across your excellent blog. Your blog brings me a great deal of fun.. Good luck with the site. https://www.evernote.com/shard/s742/sh/616f4bbc-b899-41e6-b4b4-5f0183299ff5/c7ae5029db55e4ad39cb9dce0801fd4a


Alpine Exteriors is your trusted exterior contractor in Calgary. It takes serious professionals, passionate workmanship, and high-quality materials to build a safer home. At Alpine Exteriors we take our work seriously and provide the best customer service that you will find in a home renovation company. We understand we are building homes for real people. To ensure the safety of every person living under the roof made by the hands of our workers, we bring in only the highest quality materials from the most well-known roofing material companies in Canada – it satisfies you and makes us happy. https://www.alpineexteriors.ca/


Great post full of useful tips! My site is fairly new and I am also having a hard time getting my readers to leave comments. Analytics shows they are coming to the site but I have a feeling “nobody wants to be first”. http://www.bricksite.com/hilariouspastor80/deciding-on-a-fishing-kayak

family matching outfits

Search engines are getting more complex and Google rankings are basing their rankings on "quality" over volume. Quality is what we provide.With extensive experience in SEO management, rest assured we shall complete the task and achieve first page rankings. family matching outfits

Awesome post, and incredible

Awesome post, and incredible site. A debt of gratitude is in order for the data! The Author Incubator

I as of late ran over your

I as of late ran over your online journal and have been perusing along. I thought I would leave my first remark. I don't realize what to say with the exception of that I have delighted in perusing. Pleasant website. I will continue going by this web journal all the time. The Author Incubator

sewage backup cleanup

Water & Fire damage restoration - mold remediation. sewage backup cleanup

sewage backup cleanup

Water & Fire damage restoration - mold remediation. sewage backup cleanup

Akron Deck Builders

Akron Deck Builders provides high quality affordable decks to the Akron Ohio area.

New site is solid. A debt of

New site is solid. A debt of gratitude is in order for the colossal exertion. Hay Day Hack

voyance par telephone

Nice to be visiting your blog again, it has been months for me. Well this article that i’ve been waited for so long. I need this article to complete my assignment in the college, and it has same topic with your article. Thanks voyance par telephone

Location of Le Quest

Excellent publish i have to state as well as many thanks for that info. Training happens to be a sticky topic. Nevertheless, continues to be one of the top subjects in our period. We value your own publish as well as anticipate much more.Location of Le Quest

domino qiu qiu online

Too many codes to use this software. Could you give me shortcut to use this application? domino qiu qiu online

idc thailand

I'll never try it. My laptop is ruin. idc thailand

شركة نقل اثاث بالجبيل

Nice to be visiting your blog again, it has been months for me. Well this article that i’ve been waited for so long. I need this article to complete my assignment in the college, and it has same topic with your article. Thanks,شركة نقل اثاث بالجبيل