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?
Comments
Comment #13
smustgrave CreditAttribution: smustgrave at Mobomo commentedWonder if this is still needed for D10?