file_styles_styles_styles() has this line:
$all_styles['image'] = $all_styles['file'];
Which results in styles_field_formatter_info() creating a formatter per image style for the image field type. But D7 image.module already provides a "Image" formatter with settings to select an image style. So the "Image Style ..." formatters are redundant and confusing to the user. The idea behind Styles module is to provide formatters for field types whose content can drive the details of how to display. So, for example, a File field can be displayed differently based on whether the actual file uploaded is an image or a video, and the core formatter system doesn't allow for that, and that's what Styles module is meant to address. But Image fields are constrained to be images, so they don't require this indirection. I think it makes sense to limit File Styles module to act on File fields only, and not on Image fields.
Thoughts?
Comment | File | Size | Author |
---|---|---|---|
#4 | 924644-styles.patch | 1.45 KB | effulgentsia |
Comments
Comment #1
aaron CreditAttribution: aaron commentedthat makes sense to me. in the early days of media development, we'd wanted to actually override images & file fields entirely, but scrapped that idea in favor of a new media entity. i suspect this was a remnant of that...
Comment #2
aaron CreditAttribution: aaron commentedshould be ok now. thanks!
Comment #4
effulgentsia CreditAttribution: effulgentsia commentedThanks. A little late, but here's an update function for it.
Comment #5
aaron CreditAttribution: aaron commentedcommitted. thanks effulgentsia!