Install
Works with Drupal: ^11Using Composer to manage Drupal site dependencies
Alternative installation files
Release notes
Two additions aimed at what sites were forking the module to get, and one fix behind them.
Several image styles from one field. Raw Image URL produced a single URL, at the selected style. A component needing a second size — the strip of thumbnails under a full-width visual — had no answer, and at least one site forked the module to hard-code a second URL on the thumbnail style.
Extra styles are now ticked in Manage display and each given a key. They appear next to the existing keys:
{{ data.field_image.url }} the selected style, as before {{ data.field_image.thumb.url }} an extra style, under the key you chose {{ data.field_image.thumb.width }}
Each extra style is a map of url, width and height, never a bare URL: the dimensions have to travel with the URL they belong to. The key names a style, not a URL.
Only the ticked styles are stored, so adding an image style to the site never moves the exported display config. A key colliding with url, alt, title, width, height or with another style's key is refused when the display is saved, rather than letting one key quietly overwrite another.
This is not the responsive srcset problem, which is several sizes of one rendering. Core's Responsive Image module answers that one.
A formatter for file fields. The module covered no file field at all, which pushed sites to write their own. raw_file exposes:
['url' => …, 'name' => 'notice.pdf', 'description' => '', 'mime' => 'application/pdf', 'size' => 182344]The size stays in raw bytes — turning it into "1.2 MB" is presentation, and the template is where the reader's locale is known. View access on the file entity is checked, so a private file does not leak through the data, and a file left unticked by Enable Display field stays out, the same semantics as the core file formatters.
Fixed: the image styles are declared as config dependencies, which they never were. Deleting a style left the display pointing at one that no longer existed. The main setting now falls back to the original image, and a deleted extra style is dropped from the setting.
Updating: nothing to do. No breaking change — a display with no extra style ticked produces exactly what it produced in alpha6, and raw_file only adds a formatter to the list.