contextual_contextual_links_view_alter

contextual_contextual_links_view_alter(&$element, $items)

Implements hook_contextual_links_view_alter().

See also

\Drupal\contextual\Plugin\views\field\ContextualLinks::render()

File

core/modules/contextual/contextual.module, line 147
Adds contextual links to perform actions related to elements on a page.

Code

function contextual_contextual_links_view_alter(&$element, $items) {
  if (isset($element['#contextual_links']['contextual'])) {
    $encoded_links = $element['#contextual_links']['contextual']['metadata']['contextual-views-field-links'];
    $element['#links'] = Json::decode(rawurldecode($encoded_links));
  }
}
doc_Drupal
2016-10-29 08:58:51
Comments
Leave a Comment

Please login to continue.