By fago on
Change record status:
Published (View all published change records)
Project:
Introduced in branch:
7.x-1.x
Introduced in version:
1.1
Issue links:
Description:
Currently the template_preprocess_entity() defines the following template suggestions:
// Add suggestions.
$variables['theme_hook_suggestions'][] = $entity_type;
$variables['theme_hook_suggestions'][] = $entity_type . '__' . $bundle;
$variables['theme_hook_suggestions'][] = $entity_type . '__' . $bundle . '__' . $variables['view_mode'];
if ($id = entity_id($entity_type, $entity)) {
$variables['theme_hook_suggestions'][] = $entity_type . '__' . $id;
}
However, until now corresponding templates provided by themes were only discovered if the entity-type providing module also defines a template file named {$entity_type} - what modules rarely do. With #1462772: template suggestions are not working if no custom template is defined this got fixed, such that the corresponding templates provided by themes are picked up even if the entity type providing module does not define any template.
Note that template files with an underscore - e.g. commerce_order must use dashes, e.g. commerce-order.tpl.php.
Impacts:
Themers