public function InlineBlock::buildConfigurationForm in Drupal 8
Same name and namespace in other branches
- 9 core/modules/layout_builder/src/Plugin/Block/InlineBlock.php \Drupal\layout_builder\Plugin\Block\InlineBlock::buildConfigurationForm()
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
- core/
modules/ layout_builder/ src/ Plugin/ Block/ InlineBlock.php, line 257
Class
- InlineBlock
- Defines an inline block plugin type.
Namespace
Drupal\layout_builder\Plugin\BlockCode
public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
$form = parent::buildConfigurationForm($form, $form_state);
if ($this->isNew) {
// If the Content Block is new then don't provide a default label.
unset($form['label']['#default_value']);
}
$form['label']['#description'] = $this
->t('The title of the block as shown to the user.');
return $form;
}