I'm confused about why field--fences-h2--node.tpl.php is read, but field--fences-h2--product-display.tpl.php is not

Comments

Cookiz’s picture

Status: Active » Closed (won't fix)

your custom file is not read because in the template.php file in omega_kickstart we've added a new hook_suggestion to read the -h2--node file.

So in order to read your -h2--product-display file you'll need to add these lines in your custom theme

/**
 * Preprocess field.
 */
function THEMENAME_preprocess_field(&$variables) {
  $element = $variables['element'];
  if ($element['#entity_type'] != 'node' || $element['#field_name'] != 'title_field') {
    return;
  }
  $variables['theme_hook_suggestions'][] = 'field__fences_h2__product_display';
}

Sorry for the late answer.