class GridStackFileFormatter in GridStack 8
Same name and namespace in other branches
- 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
- class \Drupal\gridstack\Plugin\Field\FieldFormatter\GridStackFileFormatterBase extends \Drupal\blazy\Plugin\Field\FieldFormatter\BlazyFileFormatterBase
- class \Drupal\gridstack\Plugin\Field\FieldFormatter\GridStackFileFormatter uses \Drupal\blazy\Dejavu\BlazyVideoTrait, GridStackFormatterTrait
Expanded class hierarchy of GridStackFileFormatter
File
- src/
Plugin/ Field/ FieldFormatter/ GridStackFileFormatter.php, line 11
Namespace
Drupal\gridstack\Plugin\Field\FieldFormatterView 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';
}
}