You are here

public function MicrositePluginTrait::buildConfigurationForm in Entity Reference Hierarchy 8.2

Same name and namespace in other branches
  1. 3.x modules/entity_hierarchy_microsite/src/Plugin/MicrositePluginTrait.php \Drupal\entity_hierarchy_microsite\Plugin\MicrositePluginTrait::buildConfigurationForm()
1 call to MicrositePluginTrait::buildConfigurationForm()
MicrositeMenu::buildConfigurationForm in modules/entity_hierarchy_microsite/src/Plugin/Block/MicrositeMenu.php
Creates a generic configuration form for all block types. Individual block plugins can add elements to this form by overriding BlockBase::blockForm(). Most block plugins should not override this method unless they need to alter the generic form elements.

File

modules/entity_hierarchy_microsite/src/Plugin/MicrositePluginTrait.php, line 74

Class

MicrositePluginTrait
Defines a trait for microsite plugin functionality.

Namespace

Drupal\entity_hierarchy_microsite\Plugin

Code

public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
  $form['field'] = [
    '#type' => 'select',
    '#title' => $this
      ->t('Entity hierarchy field'),
    '#options' => $this
      ->getFieldOptions(),
    '#empty_option' => 'None',
    '#empty_value' => '',
    '#default_value' => $this->configuration['field'],
    '#description' => $this
      ->t('Select the field to use to identify if the current node is the child of a microsite'),
  ];
  return parent::buildConfigurationForm($form, $form_state);
}