class SlickFileFormatter in Slick Carousel 8
Same name and namespace in other branches
- 8.2 src/Plugin/Field/FieldFormatter/SlickFileFormatter.php \Drupal\slick\Plugin\Field\FieldFormatter\SlickFileFormatter
- 7.3 src/Plugin/Field/FieldFormatter/SlickFileFormatter.php \Drupal\slick\Plugin\Field\FieldFormatter\SlickFileFormatter
Plugin implementation of the 'Slick File' formatter to get ME within images.
This is not 'Slick Media', instead a simple mix of image and optional video.
Hierarchy
- class \Drupal\slick\Plugin\Field\FieldFormatter\SlickFileFormatterBase extends \Drupal\blazy\Plugin\Field\FieldFormatter\BlazyFileFormatterBase
- class \Drupal\slick\Plugin\Field\FieldFormatter\SlickFileFormatter uses \Drupal\blazy\Dejavu\BlazyVideoTrait, SlickFormatterTrait
Expanded class hierarchy of SlickFileFormatter
File
- src/
Plugin/ Field/ FieldFormatter/ SlickFileFormatter.php, line 13
Namespace
Drupal\slick\Plugin\Field\FieldFormatterView source
class SlickFileFormatter extends SlickFileFormatterBase {
use SlickFormatterTrait;
use BlazyVideoTrait;
/**
* {@inheritdoc}
*/
public function buildSettings() {
return [
'blazy' => TRUE,
] + parent::getSettings();
}
/**
* {@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';
}
}