function hook_entity_prepare_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/api.elmsln.org/includes/bootstrap.inc).
cis7 system.api.php hook_entity_prepare_view($entities, $type, $langcode)
cle7 system.api.php hook_entity_prepare_view($entities, $type, $langcode)
elmsmedia7 system.api.php hook_entity_prepare_view($entities, $type, $langcode)
icor7 system.api.php hook_entity_prepare_view($entities, $type, $langcode)
meedjum_blog7 system.api.php hook_entity_prepare_view($entities, $type, $langcode)
mooc7 system.api.php hook_entity_prepare_view($entities, $type, $langcode)

Act on entities as they are being prepared for view.

Allows you to operate on multiple entities as they are being prepared for view. Only use this if attaching the data during the entity_load() phase is not appropriate, for example when attaching other 'entity' style objects.

Parameters

$entities: The entities keyed by entity ID.

$type: The type of entities being loaded (i.e. node, user, comment).

$langcode: The language to display the entity in.

Related topics

1 function implements hook_entity_prepare_view()

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

context_entity_prepare_view in sites/all/modules/ulmus/context/context.core.inc
Implementation of hook_entity_prepare_view().
3 invocations of hook_entity_prepare_view()
entity_prepare_view in includes/common.inc
Invoke hook_entity_prepare_view().
field_attach_prepare_view in modules/field/field.attach.inc
Prepare field data prior to display.
field_view_field in modules/field/field.module
Returns a renderable array for the value of a single field in an entity.

File

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

Code

function hook_entity_prepare_view($entities, $type, $langcode) {
  // Load a specific node into the user object for later theming.
  if ($type == 'user') {
    $nodes = mymodule_get_user_nodes(array_keys($entities));
    foreach ($entities as $uid => $entity) {
      $entity->user_node = $nodes[$uid];
    }
  }
}
Error | ELMSLN API

Error

×

Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/api.elmsln.org/includes/common.inc:2791) in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/api.elmsln.org/sites/all/modules/apc/drupal_apc_cache.inc).
The website encountered an unexpected error. Please try again later.