function Node::display_options_row

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

Set the row style and row style plugins to the display_options.

2 calls to Node::display_options_row()
Node::blockDisplayOptions in core/modules/node/src/Plugin/views/wizard/Node.php
Retrieves the block display options.
Node::pageDisplayOptions in core/modules/node/src/Plugin/views/wizard/Node.php
Retrieves the page display options.

File

core/modules/node/src/Plugin/views/wizard/Node.php, line 219

Class

Node
Tests creating node views with the wizard.

Namespace

Drupal\node\Plugin\views\wizard

Code

protected function display_options_row(&$display_options, $row_plugin, $row_options) {
    switch ($row_plugin) {
        case 'full_posts':
            $display_options['row']['type'] = 'entity:node';
            $display_options['row']['options']['view_mode'] = 'full';
            break;
        case 'teasers':
            $display_options['row']['type'] = 'entity:node';
            $display_options['row']['options']['view_mode'] = 'teaser';
            break;
        case 'titles_linked':
        case 'titles':
            $display_options['row']['type'] = 'fields';
            $display_options['fields']['title']['id'] = 'title';
            $display_options['fields']['title']['table'] = 'node_field_data';
            $display_options['fields']['title']['field'] = 'title';
            $display_options['fields']['title']['settings']['link_to_entity'] = $row_plugin === 'titles_linked';
            $display_options['fields']['title']['plugin_id'] = 'field';
            break;
    }
}

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