public function InstagramEmbedFormatter::settingsForm in Media entity Instagram 3.x
Same name and namespace in other branches
- 8.2 src/Plugin/Field/FieldFormatter/InstagramEmbedFormatter.php \Drupal\media_entity_instagram\Plugin\Field\FieldFormatter\InstagramEmbedFormatter::settingsForm()
- 8 src/Plugin/Field/FieldFormatter/InstagramEmbedFormatter.php \Drupal\media_entity_instagram\Plugin\Field\FieldFormatter\InstagramEmbedFormatter::settingsForm()
Returns a form to configure settings for the formatter.
Invoked from \Drupal\field_ui\Form\EntityDisplayFormBase to allow administrators to configure the formatter. 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 elements for the formatter settings.
Overrides OEmbedFormatter::settingsForm
File
- src/
Plugin/ Field/ FieldFormatter/ InstagramEmbedFormatter.php, line 114
Class
- InstagramEmbedFormatter
- Plugin implementation of the 'instagram_embed' formatter.
Namespace
Drupal\media_entity_instagram\Plugin\Field\FieldFormatterCode
public function settingsForm(array $form, FormStateInterface $form_state) {
$elements = parent::settingsForm($form, $form_state);
$elements['hidecaption'] = [
'#type' => 'checkbox',
'#title' => $this
->t('Hide caption'),
'#default_value' => $this
->getSetting('hidecaption'),
'#description' => $this
->t('Hide caption of Instagram posts.'),
];
unset($elements['max_height']);
return $elements;
}