You are here

public function EntityBlock::buildConfigurationForm in Entity Blocks 8

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.

Overrides BlockPluginTrait::buildConfigurationForm

See also

\Drupal\Core\Block\BlockBase::blockForm()

File

src/Plugin/Block/EntityBlock.php, line 123

Class

EntityBlock
Provides the block for similar articles.

Namespace

Drupal\entity_block\Plugin\Block

Code

public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
  $form = parent::buildConfigurationForm($form, $form_state);

  // Hide default block form fields that are undesired in this case.
  $form['admin_label']['#access'] = FALSE;
  $form['label']['#access'] = FALSE;
  $form['label_display']['#access'] = FALSE;

  // Hide the block title by default.
  $form['label_display']['#value'] = FALSE;
  return $form;
}