You are here

protected function SlickImageFormatter::getCaption in Slick Carousel 7.3

Build caption element if so configured can be used for thumbnail caption.

Overrides SlickFormatterBase::getCaption

1 call to SlickImageFormatter::getCaption()
SlickImageFormatter::buildElement in src/Plugin/Field/FieldFormatter/SlickImageFormatter.php
Build individual item if so configured such as for file entity goodness.

File

src/Plugin/Field/FieldFormatter/SlickImageFormatter.php, line 15

Class

SlickImageFormatter
Plugin implementation of the 'Slick Image' formatter.

Namespace

Drupal\slick\Plugin\Field\FieldFormatter

Code

protected function getCaption($item, $caption, $settings) {
  return empty($item->{$caption}) ? [] : [
    '#markup' => filter_xss_admin($item->{$caption}),
  ];
}