Update to Drupal 8.0.0-beta15. For more information, see: https://www.drupal.org/node/2563023
This commit is contained in:
parent
2720a9ec4b
commit
f3791f1da3
1898 changed files with 54300 additions and 11481 deletions
|
@ -0,0 +1,11 @@
|
|||
# Schema for the configuration files of the Responsive image test theme module.
|
||||
field.formatter.settings.responsive_image_test:
|
||||
type: mapping
|
||||
label: 'Responsive image list format settings'
|
||||
mapping:
|
||||
responsive_image_style:
|
||||
type: string
|
||||
label: 'Responsive image style'
|
||||
image_link:
|
||||
type: string
|
||||
label: 'Link image to'
|
|
@ -0,0 +1,39 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\responsive_image_test_module\Plugin\Field\FieldFormatter\ResponsiveImageTestFormatter.
|
||||
*/
|
||||
|
||||
namespace Drupal\responsive_image_test_module\Plugin\Field\FieldFormatter;
|
||||
|
||||
use Drupal\responsive_image\Plugin\Field\FieldFormatter\ResponsiveImageFormatter;
|
||||
use Drupal\Core\Field\FieldItemListInterface;
|
||||
|
||||
/**
|
||||
* Plugin to test responsive image formatter.
|
||||
*
|
||||
* @FieldFormatter(
|
||||
* id = "responsive_image_test",
|
||||
* label = @Translation("Responsive image test"),
|
||||
* field_types = {
|
||||
* "image",
|
||||
* }
|
||||
* )
|
||||
*/
|
||||
class ResponsiveImageTestFormatter extends ResponsiveImageFormatter {
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function viewElements(FieldItemListInterface $items) {
|
||||
$elements = parent::viewElements($items);
|
||||
// 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;
|
||||
}
|
||||
}
|
Reference in a new issue