You are here

function hook_message_view in Message 7

Same name and namespace in other branches
  1. 8 message.api.php \hook_message_view()

Act on a message that is being assembled before rendering.

Parameters

$message: The message entity.

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

$langcode: The language code used for rendering.

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

See also

hook_entity_prepare_view()

hook_entity_view()

File

./message.api.php, line 31
Hooks provided by the Message module.

Code

function hook_message_view($message, $view_mode, $langcode) {
  $message->content['my_additional_field'] = array(
    '#markup' => $additional_field,
    '#weight' => 10,
    '#theme' => 'mymodule_my_additional_field',
  );
}