Hi guys,

we are using your CKEditor module for our latest project and we are quite happy with the output. Unfortunately, it doesn't come currently with a way to add alt and title attributes, when you insert an image through the media module.

I had to do a small adjustment to the library.js and also on the media module site. I'll post my patches shortly for your review.

Johannes

Comments

johannez’s picture

StatusFileSize
new2.9 KB

Hello again,

here is my patch. It does the change in the ckeditor module (7.x-1.6) and the media module (1.x-dev 2012-Mar-08).

I hope somebody will find this useful and you will work towards a better solution in the future.

Cheers

LTech’s picture

does this patch work with media 7x1.2?

kevinchampion’s picture

StatusFileSize
new825 bytes

Attached patch takes the relevant addition in library.js and applies it to 7.x-1.x head, which seems to work for me.

Of note, the alt attribute is the only one I found missing. The title attribute was applied fine before this patch. As a result, I'm not sure if this is the most appropriate place and method for this fix.

wwalc’s picture

Status: Active » Needs review
miroslavbanov’s picture

Patch #3 work for me.
Add one space at the statrt of comment: // comment
Do we need to delete the "alt" and "title" so they are not made as classes? I think they should be left as is.

miroslavbanov’s picture

Status: Needs review » Needs work
barancekk’s picture

Issue summary: View changes
StatusFileSize
new971 bytes

I tested #3 with media 7.x-2.0-alpha3 and it's not working for me. When inserting image with media popup window from library this provide fields to alter alt and title values. After changing the values using 7.x-2.0-alpha3 media and submitting the media popup these are present in addImageAttributes in addition variable which is used in patch from #3 but the values are now in additional['field_file_image_alt_text[und][0][value]'] for alt text and additional['field_file_image_title_text[und][0][value]'].

I created new patch reflecting this changes after which correct title and alt text values are used for inserted image.

wingmanjd’s picture

Patch from #7 no longer applies to 7.x-1.7 as media/library.js has been removed.