Problem/Motivation
Follow up issue for #2829990: Image formatter does not support URL/Link options
When using a responsive image field formatter and adding a link to a file or hosting entity, URL options are not handled by the native image formatter so it is impossible to add a class or other attributes to the generated link...
function : template_preprocess_responsive_image_formatter
template : responsive-image-formatter.html.twig
Proposed resolution
Use the link()
Twig method to render the linked responsive image, so URL options are output as expected.
Remaining tasks
- Review
- Commit
User interface changes
None.
API changes
Linked responsive images can now render link attributes.
Data model changes
None.