You are here

public function BlockDescription::settingsForm in Display Suite 8.4

Same name and namespace in other branches
  1. 8.2 src/Plugin/DsField/Block/BlockDescription.php \Drupal\ds\Plugin\DsField\Block\BlockDescription::settingsForm()
  2. 8.3 src/Plugin/DsField/Block/BlockDescription.php \Drupal\ds\Plugin\DsField\Block\BlockDescription::settingsForm()

The form that holds the settings for this plugin.

Parameters

array $form: The form definition array for the field configuration form.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

Return value

array The renderable form array representing the entire configuration form.

Overrides DsFieldBase::settingsForm

File

src/Plugin/DsField/Block/BlockDescription.php, line 50

Class

BlockDescription
Plugin that renders the title of a block.

Namespace

Drupal\ds\Plugin\DsField\Block

Code

public function settingsForm($form, FormStateInterface $form_state) {
  $config = $this
    ->getConfiguration();
  $settings['wrapper'] = [
    '#type' => 'textfield',
    '#title' => 'Wrapper',
    '#default_value' => $config['wrapper'],
    '#description' => $this
      ->t('Eg: h1, h2, p'),
  ];
  $settings['class'] = [
    '#type' => 'textfield',
    '#title' => 'Class',
    '#default_value' => $config['class'],
    '#description' => $this
      ->t('Put a class on the wrapper. Eg: block-title'),
  ];
  return $settings;
}