You are here

public function BlazyEntityReferenceBase::settingsForm in Blazy 8.2

Same name and namespace in other branches
  1. 8 src/Dejavu/BlazyEntityReferenceBase.php \Drupal\blazy\Dejavu\BlazyEntityReferenceBase::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 BlazyEntityMediaBase::settingsForm

File

src/Dejavu/BlazyEntityReferenceBase.php, line 98

Class

BlazyEntityReferenceBase
Base class for all entity reference formatters with field details.

Namespace

Drupal\blazy\Dejavu

Code

public function settingsForm(array $form, FormStateInterface $form_state) {
  $element = parent::settingsForm($form, $form_state);
  if (isset($element['layout'])) {
    $layout_description = $element['layout']['#description'];
    $element['layout']['#description'] = $this
      ->t('Create a dedicated List (text - max number 1) field related to the caption placement to have unique layout per slide with the following supported keys: top, right, bottom, left, center, center-top, etc. Be sure its formatter is Key.') . ' ' . $layout_description;
  }
  if (isset($element['overlay']['#description'])) {
    $element['overlay']['#description'] .= ' ' . $this
      ->t('The formatter/renderer is managed by the child formatter.');
  }
  return $element;
}