I wanted little images relating to the taxonomy of the event (in this case, the hosting organization). Add the following piece of code at the beginning of the function theme_event_node_month in the file event.theme (just the if-statement shown below). Put it as the first line of code in the function.works for 4.6 (NOT FOR 4.7)

/**
 * Format an event node for display in an expanded calendar, like a calendar page
 *
 * @param node
 *   The node being displayed
 * @param module
 *   The name of the external module calling the function. Default: null;
 */
function theme_event_node_month($node, $module = NULL) {
  static $stripe, $stripe_map;

if (module_exist("taxonomy_image") ) {
      foreach (taxonomy_node_get_terms($node->nid) as $term) {
        $images[] = taxonomy_image_display($term->tid, "alt='$term->name'");
      }
}
.
.
.
.

Comments

rosenblum68’s picture

Title: here's how to make taxonomy images show up in the calendar » OOPS CORRECTION, forgot a line of code; also works in 4.7

Sorry, I forgot a line.

After adding the above, replace the following line in the same function:

  $output .= '<div class="title">'. l($node->title, "node/$node->nid", array('title' => t('view this event'))) .'</div>'."\n";

with this line of code:

  $output .= '<div class="title">'. ($images ? "<div class=\"taxonomy-image\">". implode(' ', $images) ."</div>" : '') . l($node->title, "node/$node->nid", array('title' => t('view this event'))) .'</div>'."\n";

Also, this works in 4.7 as well. I was using versions of event.theme:

// $Id: event.theme,v 1.5.2.15 2005/10/04 12:02:30 killes Exp $
// $Id: event.theme,v 1.5.2.16 2005/12/05 03:05:53 killes Exp $

rosenblum68’s picture

Title: OOPS CORRECTION, forgot a line of code; also works in 4.7 » here's how to make taxonomy images show up in the event calendar

[ignore, im changing title]

nrasmus’s picture

Cool idea--could you possibly assist this relative php newb--I'd like the taxonomy term (text) to appear in the event listing (so it would appear in a calendar, not just above it). Is this easy to achieve?

nrasmus’s picture

Nevermind--I decided to make images, and use your suggestion. It is very nice! Any chance this functionality can be added to event, or taxonomy_images? I'd like to see this futureproofed.

Thanks!!!!

killes@www.drop.org’s picture

Status: Active » Closed (fixed)

This version of event.module is no longer supported. Please update your site. If the issue is still valid, don't hesitate to re-open it against a more recent version.