diff --git a/entity.module b/entity.module index 08e4662..1a4b9b2 100644 --- a/entity.module +++ b/entity.module @@ -834,6 +834,12 @@ function entity_flush_caches() { * Implements hook_theme(). */ function entity_theme() { + // Build a pattern in the form of "type1__|type2__|type3__" such that all + // templates starting with an entity type are found. + // @see template_preprocess_entity() + $types = array_keys(entity_crud_get_info()); + $pattern = implode('__|', $types) . '__'; + return array( 'entity_status' => array( 'variables' => array('status' => NULL, 'html' => TRUE), @@ -841,6 +847,7 @@ function entity_theme() { 'entity' => array( 'render element' => 'elements', 'template' => 'entity', + 'pattern' => $pattern, ), 'entity_ui_overview_item' => array( 'variables' => array('label' => NULL, 'entity_type' => NULL, 'url' => FALSE, 'name' => FALSE),