4

I am seeking for a method to enable users to:

  • choose image style (thumbnail, medium, large, ...) during content creation
  • change this style anytime during content update

Right now, with "Image" module on, the image field style can be decided only during content type creation.

I tried to use "Media" module 7.2, and there is possibility to choose image style during content creation, but no possibility to change it later.

3 Answers 3

1

I have the same issue. I couldn't get the formatter field module to work. However, this module looks like it's currently working for what I need it for: Image Style Selector

It looks like it only has an alpha branch and it has a relatively small install base. Still, not seeing any issues with it so far.

Edit: Looks like I can't use the colorbox module with this one though.

1

The Formatter Field module looks like the right one. Here is a quote about it (from the module's project page):

... provides a mechanism for specifying a formatter and formatter settings to be used for displaying a field, on a per-entity basis. By default, Drupal provides formatters and settings per entity bundle, but in certain situations it is necessary to choose the formatter at the entity level.

For example, say you have a page node with an image field. Normally, you would select an image style as the formatter, and all page nodes would use that same image style. With this module, you can add a formatter field to page nodes, which is hooked up to the image field. Then when the node is created or edited, the image style can be selected per-node.

1
  • FWIW, I just tried this module out and it didn't work. I added a formatter field that used an image field as its target and no matter what, the formatter selected in the Manage Display tab was not overridden by the formatter field. Just one person's experience.
    – cdmo
    Commented Oct 9, 2013 at 13:37
0

There is a simple way to do it. You can simply add a field radio buttons with all style that you would like to propose.

Then when you display your image, you can simply create the URL with the chosen style with this field.

This theme function then will help you to retrieve the image with the style.

2
  • You mean, use a field_collection module? Because image field can be multiple value, so every image should have its own formatting option, and I don't know any other way to add a radio to each image.
    – camcam
    Commented Jul 2, 2012 at 18:12
  • Since you can add fields to file types, you could add the image style field there.
    – thumbson
    Commented Feb 13, 2015 at 3:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.