I have a website that will have events and game dates for roller derby teams across the nation (
http://www.derbynation.net).. The Upcoming Events Block only shows the event title. I want it to also show the league name or the state.

How can I modify the Upcoming Events Block and the Event List View to include a custom field for the league name (field_league_nm)?

I also want to modify the Event List View to include the league name (field_league_nm) and the state (field_event_state).

Any help is greatly appreciated. I do not mind modifying the event.module file. I dont want to create a new content type and views simply because I like how events handles events.

Thanks in advance for any help.

Comments

soadchik’s picture

Okay I modified this in the event.theme file. It doesnt work. I'm new to drupal and to php. I think all I need is where to point to for the data I want to show. Where is field_league_nm at? How can I call it so it will be displayed in the Upcoming Events Block?

function theme_event_upcoming_item($node, $types = array()) {
  $output = l($node->title, "node/$node->nid", array('attributes' => array('title' => $node->title)));
  if (count($types) > 1) {
    $output .= '<span class="event-nodetype">('. $node->event['node_type'] .')</span>';
  }
  //Added the line below to try and call the league name.  It does not work.
  $output .= '<br><span class="event-custom">'. $node->event['field_league_nm'] .'</span>';
  $output .= '<span class="event-timeleft">'. event_format_date($node->event_start, 'custom', "D M j @ G:ia").'</span>';
  return $output;
}

Thank you.

killes@www.drop.org’s picture

The upcoming events block exposes a hook which can be used to add additional information. YOu can then print that extra fields by changing the theming function.

For better integration of event.module with views, you should probably use the event_views module. Sadly, this is not yet available for Drupal 6.

killes@www.drop.org’s picture

Status: Active » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.