You are here

public function BlazyEntityReferenceBase::settingsForm in Blazy 7

Implements hook_field_formatter_settings_form().

Overrides BlazyEntityBase::settingsForm

File

src/Plugin/Field/FieldFormatter/BlazyEntityReferenceBase.php, line 175

Class

BlazyEntityReferenceBase
Base class for entity reference formatters with field details.

Namespace

Drupal\blazy\Plugin\Field\FieldFormatter

Code

public function settingsForm($form, &$form_state, $definition) {
  $element = parent::settingsForm($form, $form_state, $definition);
  if (isset($element['layout'])) {
    $layout_description = $element['layout']['#description'];
    $element['layout']['#description'] = 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['media_switch'])) {
    $element['media_switch']['#options']['rendered'] = t('Image rendered by its formatter');
    $element['media_switch']['#description'] .= ' ' . t('Be sure the enabled fields here are not hidden/disabled at its view mode.');
  }
  if (isset($element['caption'])) {
    $element['caption']['#description'] = t('Check fields to be treated as captions, even if not caption texts.');
  }
  if (isset($element['image']['#description'])) {
    $element['image']['#description'] .= ' ' . t('For video, this allows separate highres image, be sure the same field used for Image to have a mix of videos and images. Leave empty to fallback to the video provider thumbnails. The formatter/renderer is managed by <strong>@namespace</strong> formatter. Meaning original formatter ignored. If you want original formatters, check <strong>Vanilla</strong> option. Alternatively choose <strong>Media switcher &gt; Image rendered </strong>, other image-related settings here will be ignored. <strong>Supported fields</strong>: Image, Video Embed Field.', [
      '@namespace' => $this
        ->getPluginId(),
    ]);
  }
  if (isset($element['overlay']['#description'])) {
    $element['overlay']['#description'] .= ' ' . t('The formatter/renderer is managed by the child formatter. <strong>Supported fields</strong>: Image, File/ Media Entity.');
  }
  return $element;
}