You are here

function petreference_preprocess_node in Previewable email templates 6

Theme preprocess function.

Allows specific node templates for nodes displayed as values of a petreference field with the 'full node' / 'teaser' formatters.

File

modules/petreference/petreference.module, line 943
Defines a field type for referencing pet template to a node.

Code

function petreference_preprocess_node(&$vars) {

  // The 'referencing_field' attribute of the node is added by the 'teaser'
  // and 'full node' formatters.
  if (!empty($vars['pet']->referencing_field)) {
    $pet = $vars['pet'];
    $field = $pet->referencing_field;
    $vars['template_files'][] = 'pet-petreference';
    $vars['template_files'][] = 'pet-petreference-' . $field['field_name'];
  }
}