public function MetatagFirehose::settingsForm in Metatag 8
Returns a form to configure settings for the widget.
Invoked from \Drupal\field_ui\Form\EntityDisplayFormBase to allow administrators to configure the widget. The field_ui module takes care of handling submitted form values.
Parameters
array $form: The form where the settings form is being included in.
\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.
Return value
array The form definition for the widget settings.
Overrides WidgetBase::settingsForm
File
- src/
Plugin/ Field/ FieldWidget/ MetatagFirehose.php, line 80
Class
- MetatagFirehose
- Advanced widget for metatag field.
Namespace
Drupal\metatag\Plugin\Field\FieldWidgetCode
public function settingsForm(array $form, FormStateInterface $form_state) {
$element['sidebar'] = [
'#type' => 'checkbox',
'#title' => $this
->t('Place field in sidebar'),
'#default_value' => $this
->getSetting('sidebar'),
'#description' => $this
->t('If checked, the field will be placed in the sidebar on entity forms.'),
];
return $element;
}