image class

Permalink
Hi,
when adding an image to a page, is it possible to have a 'class' field for the image.
Regards,
Warren

 
adajad replied on at Permalink Reply
adajad
Not using the core image block.

You could use the Content block and add the image with classes though.
opuscambodia replied on at Permalink Reply
I think we will attempt to use this solution

http://www.concrete5.org/community/forums/usage/image-in-content-bl...
adajad replied on at Permalink Reply
adajad
What I said in short. ;)
nerdess replied on at Permalink Reply 1 Attachment
nerdess
Hi

It's actually very easy to extend the "Image" block with additional fields.

I've done that already, just download the attached archive and unzip it into your "/blocks" folder on the root of your website.

The extension adds another field "classes" to the btContentImage table, to add this new field go to "dashboard" -> "block types" and click on "Image" then "Refresh". Now the database field is added.

You also need to clear the cache to make sure Concrete5 uses the new version of the Image block now so go to "dashboard" -> "system & settings" -> "clear cache" to do that.

Now when you add/edit a block of type "Image" you get an additional input field named "Classes" where you can add one or more classes separated by a space.

Hope it works :-)
bek replied on at Permalink Reply
Hi nerdess,
Thanks for this, I had exactly the same issue and your solution worked a treat.

kind regards