/** * {@inheritdoc} */ public function viewElements(FieldItemListInterface $items, $langcode) { $elements = parent::viewElements($items, $langcode); // Unset #item_attributes to test that the theme function can handle that. foreach ($elements as &$element) { if (isset($element['#item_attributes'])) { unset($element['#item_attributes']); } } return $elements; }
/** * {@inheritdoc} */ public function viewElements(FieldItemListInterface $items, $langcode) { $images = parent::viewElements($items, $langcode); return $this->viewImages($images, $this->getSettings()); }