Pass extra options to theme_image_formatter, theme_image, theme_image_style

Created on 31 July 2012, about 12 years ago
Updated 13 July 2023, about 1 year ago

While working on a prototype for responsive images in core and making it as generic as possible so it will work with other (contrib) modules as well, I need to be able to pass extra data to theme_image (in particular #breakpoints).

I'm now using hook_field_attach_view_alter to decide if something has to be done, if so I add '#breakpoints' to each item and override #formatter (theme_image_formatter) and #theme (theme_picture). This works, but also means that if I want to support colorbox, I have to override 2-3 more theme functions, only to be able to pass #breakpoints all the way to theme_image_style.

Proposal: add $variables['#extra_info'] that's always passes around?

✨ Feature request
Status

Postponed: needs info

Version

9.5

Component
Image systemΒ  β†’

Last updated about 11 hours ago

Created by

πŸ‡§πŸ‡ͺBelgium attiks

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024