function hook_entity_view


Error message

User warning: The following module is missing from the file system: theme/theme. For information about how to fix this, see the documentation page. in _drupal_trigger_error_with_delayed_logging() (line 1156 of /var/www/html/elmsln_community/
cis7 system.api.php hook_entity_view($entity, $type, $view_mode, $langcode)
cle7 system.api.php hook_entity_view($entity, $type, $view_mode, $langcode)
elmsmedia7 system.api.php hook_entity_view($entity, $type, $view_mode, $langcode)
icor7 system.api.php hook_entity_view($entity, $type, $view_mode, $langcode)
meedjum_blog7 system.api.php hook_entity_view($entity, $type, $view_mode, $langcode)
mooc7 system.api.php hook_entity_view($entity, $type, $view_mode, $langcode)

Act on entities being assembled before rendering.


$entity: The entity object.

$type: The type of entity being rendered (i.e. node, user, comment).

$view_mode: The view mode the entity is rendered in.

$langcode: The language code used for rendering.

The module may add elements to $entity->content prior to rendering. The structure of $entity->content is a renderable array as expected by drupal_render().

See also





Related topics

6 functions implement hook_entity_view()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

cis_shortcodes_entity_view in sites/all/modules/elmsln_contrib/cis_connector/modules/cis_shortcodes/cis_shortcodes.module
Implements hook_entity_view().
entity_iframe_entity_view in sites/all/modules/elmsln_contrib/entity_iframe/entity_iframe.module
Implements hook_entity_view().
field_collection_table_entity_view in sites/all/modules/ulmus/field_collection_table/field_collection_table.module
Implements hook_entity_view().
taxonomy_test_entity_view in modules/simpletest/tests/taxonomy_test.module
Implements hook_entity_view().
template_preprocess_eva_display_entity_view in sites/all/modules/ulmus/eva/

... See full list

14 invocations of hook_entity_view()
accessibility_test_render in sites/all/modules/ulmus/accessibility/accessibility.module
comment_build_content in modules/comment/comment.module
Builds a structured array representing the comment's content.
ctools_entity_field_extra_content_type_render in sites/all/modules/ulmus/ctools/plugins/content_types/entity_context/
Render the extra field.
ctools_node_content_render_node in sites/all/modules/ulmus/ctools/plugins/content_types/node_context/
ctools_node_content_render_node in sites/all/modules/ulmus/ctools/plugins/content_types/node_context/

... See full list


modules/system/system.api.php, line 428
Hooks provided by Drupal core and the System module.


function hook_entity_view($entity, $type, $view_mode, $langcode) {
  $entity->content['my_additional_field'] = array(
    '#markup' => $additional_field,
    '#weight' => 10,
    '#theme' => 'mymodule_my_additional_field',



Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/ in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/
The website encountered an unexpected error. Please try again later.