You are here

function Node::render_link in Views (for Drupal 7) 8.3

Render whatever the data is as a link to the node.

Data should be made XSS safe prior to calling this function.

5 calls to Node::render_link()
HistoryUserTimestamp::render in lib/Views/node/Plugin/views/field/HistoryUserTimestamp.php
Render the field.
Language::render in lib/Views/node/Plugin/views/field/Language.php
Render the field.
Node::render in lib/Views/node/Plugin/views/field/Node.php
Render the field.
Revision::render_link in lib/Views/node/Plugin/views/field/Revision.php
Render whatever the data is as a link to the node.
Type::render in lib/Views/node/Plugin/views/field/Type.php
Render the field.
1 method overrides Node::render_link()
Revision::render_link in lib/Views/node/Plugin/views/field/Revision.php
Render whatever the data is as a link to the node.

File

lib/Views/node/Plugin/views/field/Node.php, line 64
Definition of Views\node\Plugin\views\field\Node.

Class

Node
Field handler to provide simple renderer that allows linking to a node. Definition terms:

Namespace

Views\node\Plugin\views\field

Code

function render_link($data, $values) {
  if (!empty($this->options['link_to_node']) && !empty($this->additional_fields['nid'])) {
    if ($data !== NULL && $data !== '') {
      $this->options['alter']['make_link'] = TRUE;
      $this->options['alter']['path'] = "node/" . $this
        ->get_value($values, 'nid');
      if (isset($this->aliases['langcode'])) {
        $languages = language_list();
        $langcode = $this
          ->get_value($values, 'langcode');
        if (isset($languages[$langcode])) {
          $this->options['alter']['language'] = $languages[$langcode];
        }
        else {
          unset($this->options['alter']['language']);
        }
      }
    }
    else {
      $this->options['alter']['make_link'] = FALSE;
    }
  }
  return $data;
}