function Node::buildOptionsForm

Same name in other branches
  1. 9 core/modules/node/src/Plugin/views/field/Node.php \Drupal\node\Plugin\views\field\Node::buildOptionsForm()
  2. 8.9.x core/modules/node/src/Plugin/views/field/Node.php \Drupal\node\Plugin\views\field\Node::buildOptionsForm()
  3. 10 core/modules/node/src/Plugin/views/field/Node.php \Drupal\node\Plugin\views\field\Node::buildOptionsForm()

Provide link to node option.

Overrides FieldPluginBase::buildOptionsForm

1 call to Node::buildOptionsForm()
HistoryUserTimestamp::buildOptionsForm in core/modules/history/src/Plugin/views/field/HistoryUserTimestamp.php
1 method overrides Node::buildOptionsForm()
HistoryUserTimestamp::buildOptionsForm in core/modules/history/src/Plugin/views/field/HistoryUserTimestamp.php

File

core/modules/node/src/Plugin/views/field/Node.php, line 49

Class

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

Namespace

Drupal\node\Plugin\views\field

Code

public function buildOptionsForm(&$form, FormStateInterface $form_state) {
    $form['link_to_node'] = [
        '#title' => $this->t('Link this field to the original piece of content'),
        '#description' => $this->t("Enable to override this field's links."),
        '#type' => 'checkbox',
        '#default_value' => !empty($this->options['link_to_node']),
    ];
    parent::buildOptionsForm($form, $form_state);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.