Hello all,
Image style preset is really a neat feature, but there is a caveat when you use it. If you have multiple themes on your Drupal installation, you may want to use the same preset name (e.g. "thumbnail") to display in the same content type build mode (e.g. "teaser"), but it might not fit with all themes.
Since the build modes are more or less theme agnostic, I think that presets should be theme aware, and each theme should be able to define its own overrides for styles.
Example, I display a node teaser in my left region in bartik, this teaser display a thumbnail, this thumbnail is 200px wide. Now, I want to display the same node in another theme in the same site, for which the left region is 400px wide, I would like my teaser preset to be displayed in 400px wide.
Since the build modes are theme agnostic, styles also are. But styles definitely are the link between the real image and its display within the theme.
Schema would be something like:
[Build mode (field_my_image)] n ---> 1 [Style (thumbnail)] n <----> n [Theme (bartik)]
Comments
Comment #1
troybthompson commentedI'm also looking for this functionality for mobile themes. Is there any workaround for doing it now in D7?
Comment #2
Jeff Burnz commentedIndeed this would be most interesting for mobile development. I wonder how a UI for this would work? For example are you saying that perhaps when we create an Image Style that is where the UI would be, that we would give our preset names like "node image" and set different styles the "node image" preset for each theme.
I would think this looks like a bit of an edge case right now, and one of those "nice to have features", however in a couple of years time this could be a required feature, due to potential demands for out-of-the-box features that ease mobile web development.
Comment #3
troybthompson commentedI imagined either
setting the style as universal or allowing you to set a different override style, i.e. "thumbnail-all themes" and "thumbnail-mobile theme"
or
specify which effects may or not be applicable for a style depending on the theme, so I'd have one style "thumbnail" with the effects:
"scale 300x300-theme 1"
"scale 150x150-theme 2"
"desaturate-all themes"
The second way may be cleaner interface-wise if 90% of the effects are the same but your sizing just needs to be different depending on your usage.
Mobile is my main thought, but in addition to mobile themes, using ImageCache Actions there are a lot of possibilities to having images that match the style of the rest of your theme better with effects you can't do with just css, such as having one theme that makes your photos look like old postcards and another where they have a different background color, etc. Or maybe one theme is very large image focused, and other people may want a more subtle image look.
Comment #4
martijn houtman commentedRelated:
http://www.koumbit.org/en/articles/theme-specific-image-styles-equivelen...
Comment #5
pacome commented-just to remember the page-
thanks for the link Martijn
Comment #6
alberto56 commentedHi all,
I just updated http://www.koumbit.org/en/articles/theme-specific-image-styles-equivelen... to reflect changes in the latest version of Drupal 7.9.
The previously documented function in my blog post breaks under drupal 7.9 due to the introduction of width and height attributes in the markup.
That being said, it would be great to have this capability in core.
Albert.
Comment #7
nod_We have picture in core now, not a mobile thing anymore.
Comment #8
claudiu.cristea@nod_ is picture doing the job for this request?
Comment #22
smustgrave commentedThank you for sharing your idea for improving Drupal.
We are working to decide if this proposal meets the Criteria for evaluating proposed changes. There hasn't been any discussion here for over 8 years which suggests that this has either been implemented or there is no community support. Your thoughts on this will allow a decision to be made.
Since we need more information to move forward with this issue, the status is now Postponed (maintainer needs more info). If we don't receive additional information to help with the issue, it may be closed after three months.
Thanks!
Comment #23
smustgrave commentedSince there has been no follow up in 3 months, going to close out. But if still a valid task then it can be re-opened
Thanks!