Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. DefaultSummary.php

function DefaultSummary::buildOptionsForm

Overrides StylePluginBase::buildOptionsForm

2 calls to DefaultSummary::buildOptionsForm()
UnformattedSummary::buildOptionsForm in core/modules/views/src/Plugin/views/style/UnformattedSummary.php
Provide a form to edit options for this plugin.
UnformattedSummary::buildOptionsForm in core/modules/views/src/Plugin/views/style/UnformattedSummary.php
Provide a form to edit options for this plugin.
1 method overrides DefaultSummary::buildOptionsForm()
UnformattedSummary::buildOptionsForm in core/modules/views/src/Plugin/views/style/UnformattedSummary.php
Provide a form to edit options for this plugin.

File

core/modules/views/src/Plugin/views/style/DefaultSummary.php, line 40

Class

DefaultSummary
The default style plugin for summaries.

Namespace

Drupal\views\Plugin\views\style

Code

public function buildOptionsForm(&$form, FormStateInterface $form_state) {
    $form['base_path'] = [
        '#type' => 'textfield',
        '#title' => $this->t('Base path'),
        '#default_value' => $this->options['base_path'],
        '#description' => $this->t('Define the base path for links in this summary
        view, i.e. http://example.com/<strong>your_view_path/archive</strong>.
        Do not include beginning and ending forward slash. If this value
        is empty, views will use the first path found as the base path,
        in page displays, or / if no path could be found.'),
    ];
    $form['count'] = [
        '#type' => 'checkbox',
        '#default_value' => !empty($this->options['count']),
        '#title' => $this->t('Display record count with link'),
    ];
    $form['override'] = [
        '#type' => 'checkbox',
        '#default_value' => !empty($this->options['override']),
        '#title' => $this->t('Override number of items to display'),
    ];
    $form['items_per_page'] = [
        '#type' => 'textfield',
        '#title' => $this->t('Items to display'),
        '#default_value' => $this->options['items_per_page'],
        '#states' => [
            'visible' => [
                ':input[name="options[summary][options][' . $this->definition['id'] . '][override]"]' => [
                    'checked' => TRUE,
                ],
            ],
        ],
    ];
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal