You are here

function entityreference_view_widget_entity_view in Entity Reference View Widget 7

Implements hook_entity_view().

File

./entityreference_view_widget.module, line 18

Code

function entityreference_view_widget_entity_view($entity, $type, $view_mode, $langcode) {
  if ($view_mode == 'entityreference_view_widget') {
    $entity_id = entity_id($type, $entity);

    // Add just a placeholder, filled in when the widget gets themed.
    $entity->content['entityreference_view_widget_action'] = array(
      '#markup' => '<!--entityreference-view-widget-action-' . $entity_id . '-->',
      '#weight' => -10,
    );
  }
}