You are here

class GridStackFileFormatter in GridStack 8

Same name and namespace in other branches
  1. 8.2 src/Plugin/Field/FieldFormatter/GridStackFileFormatter.php \Drupal\gridstack\Plugin\Field\FieldFormatter\GridStackFileFormatter

Plugin implementation of the 'GridStack' formatter to get ME within images.

Hierarchy

Expanded class hierarchy of GridStackFileFormatter

File

src/Plugin/Field/FieldFormatter/GridStackFileFormatter.php, line 11

Namespace

Drupal\gridstack\Plugin\Field\FieldFormatter
View source
class GridStackFileFormatter extends GridStackFileFormatterBase {
  use GridStackFormatterTrait;
  use BlazyVideoTrait;

  /**
   * {@inheritdoc}
   */
  public function getScopedFormElements() {
    return [
      'fieldable_form' => TRUE,
      'multimedia' => TRUE,
      'view_mode' => $this->viewMode,
    ] + parent::getScopedFormElements();
  }

  /**
   * {@inheritdoc}
   */
  public static function isApplicable(FieldDefinitionInterface $field_definition) {
    $storage = $field_definition
      ->getFieldStorageDefinition();
    return $storage
      ->isMultiple() && $storage
      ->getSetting('target_type') === 'file';
  }

}

Members

Namesort descending Modifiers Type Description Overrides
GridStackFileFormatter::getScopedFormElements public function Overrides GridStackFileFormatterBase::getScopedFormElements
GridStackFileFormatter::isApplicable public static function Overrides GridStackFormatterTrait::isApplicable
GridStackFileFormatterBase::buildElements public function Build the gridstack carousel elements.
GridStackFileFormatterBase::buildSettings public function Builds the settings.
GridStackFileFormatterBase::create public static function
GridStackFileFormatterBase::defaultSettings public static function
GridStackFileFormatterBase::settingsForm public function
GridStackFileFormatterBase::viewElements public function
GridStackFileFormatterBase::__construct public function Constructs a GridStackImageFormatter instance.
GridStackFormatterTrait::$formatter protected property The gridstack field formatter manager.
GridStackFormatterTrait::$manager protected property The gridstack field formatter manager.
GridStackFormatterTrait::admin public function Returns the gridstack admin service shortcut.
GridStackFormatterTrait::formatter public function Returns the gridstack field formatter service.
GridStackFormatterTrait::manager public function Returns the gridstack service.
GridStackFormatterTrait::settingsSummary public function