You are here

function date_ical_preprocess_node in Date iCal 7.3

Same name and namespace in other branches
  1. 7 date_ical.module \date_ical_preprocess_node()
  2. 7.2 date_ical.module \date_ical_preprocess_node()

Implements hook_preprocess_HOOK().

Hides the page elements which don't belong in an iCal DESCRIPTION element. The display of the body and other fields is controlled by the Manage Display settings for the nodes' iCal view mode.

File

./date_ical.module, line 111
Adds ical functionality to Views, and an iCal parser to Feeds.

Code

function date_ical_preprocess_node(&$variables) {
  if (isset($variables['view_mode']) && $variables['view_mode'] == 'ical') {

    // Trick the default node template into not displaying the page title, by
    // telling it that this *is* a page.
    $variables['page'] = TRUE;
    $variables['title_prefix'] = array();
    $variables['title_suffix'] = array();

    // We don't want to see the author information in our feed.
    $variables['display_submitted'] = FALSE;

    // Comments and links don't belong in an iCal feed.
    if (isset($variables['content']['comments'])) {
      unset($variables['content']['comments']);
    }
    if (isset($variables['content']['links'])) {
      unset($variables['content']['links']);
    }
  }
}