Skip to content

Instantly share code, notes, and snippets.

View tannerjfco's full-sized avatar

Tanner J Ferguson tannerjfco

View GitHub Profile
@jacine
jacine / field.tpl.php
Created August 31, 2011 18:33
My default hook_preprocess_field() and field.tpl.php
<?php
/**
* Implements template_preprocess_field().
*/
function THEME_preprocess_field(&$vars) {
// If the view mode is "full" use <h2> for the field labels. Otherwise,
// assume a teaser or more compact view mode is being displayed, and use <h3>.
$vars['heading'] = ($vars['element']['#view_mode'] == 'full') ? 'h2' : 'h3';