Add class to image field I'm looking for a way to add a class field to Drupal's image field (field_image). At the moment my images are displayed using code like this:

&lt;img alt="Alternate text here" src="/path/to/image" /&gt;


I'd like to add a class field so that the code would be like so:

&lt;img alt="Alternate text here" class="portrait floatLeft" src="/path/to/image" /&gt;


I think I could achieve this by adding a field to the content type to store the class name - I could then use views to add the class value to the image's parent DIV. However, I suspect there's a way to add a class field to the image field itself - it's not uncommon for images to have classes ;)

I've tried the File Entity module, which according to the documentation allows you to create custom file types. Sadly it doesn't explain how.

Any pointers / suggestions would be much appreciated.

Edit: To clarify, I'd like to be able to add classes on a per image basis. Some images might need the classes portrait floatLeft, others might need landscape floatNone and so forth.
Consider looking at the Image Class module, which extends the Image formatter by adding an option to add an element class.

It requires the Field formatter settings module (dependency).