1

I have a library of images that I access for reuse via the Media (ver. 2.0) Browser and attach to nodes using the file field. When I use an image inside a node, I want to indicate a specific Image Style (e.g. "Thumbnail", "Medium", etc.). The out of the box setup of D7 let me specify one (1) image style to be used for a field in each display mode (i.e. "Default" and "Teaser"). I want to be able to choose between image styles.

I may want to use the "Medium" style for the first image field in one node, and "Large" in for the first field in another.

After some googling, I've found some suggestions for doing this, but they're all based upon using WYSIWYG for image insertion, and I don't want WYSIWYG.

Looking at the answer to Multiple image styles, I see that I can do get access to different image cache versions of an image through either template file or hook_preprocess_node() - so I should probably be able to do this with a custom module that manipulates the image field render object during preprocessing.

However, before I embark upon writing such a custom module, I want to ask if this module (or something similar to it) already exists? I have searched for it, but so far found nothing that does not use WYSIWYG.

0

As I can see Entity Image Style can be used with the Field collection module to achieve this task. However the Entity Image Style module is not yet a stable module. As per the logic this should achieve your goal.

Other resources: Formatter Field module

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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