In Drupal 7, how can I set image alternative text as required in "Body" field (CKEditor), "image" field and file upload by using "Media" module?

---- updated info for betherwisser on Aug. 20, 2014 @ 12:17pm
I know there is a file types section in Media but it is different from what you mentioned. However, It does not have the Alt text field option there. Please see screenshot for details. enter image description here

ALSO, there is an option on image file for Alt Text but I'm not able to make that as required. See below screenshot. enter image description here

  • That second screenshot is of the field setting for where you add the image, not for the field settings of fields on the image. – beth Aug 20 '14 at 16:26
  • @betherwisser the first screenshot is the field on image but I dont see the Alt text option. :( – CocoSkin Aug 20 '14 at 17:06
  • That doesn't look like an image, but I can't tell what file type it is because the file type name doesn't appear in the screenshot. Regardless, if you want a field that is not there yet, you can add it and use a view mode to control its display. – beth Aug 20 '14 at 18:05
  • @betherwisser the file type on first screenshot is "image". There is no Alt Text field option as showed on first screenshot. I only can add text field and named as "Alt Text", but it would not be the real Alt Text. – CocoSkin Aug 20 '14 at 19:25

I found one of the solution by using EIM module. I understand this is not the best solution but this module able to enable Alt field required on image field by content type.

---- updated info on Aug. 22nd 2014 @ 11:12pm The EIM module adds checkboxes for the fields of image editing forms by content type. Including "Alt field required" and "Title field required". See below screenshot for details.

enter image description here

| improve this answer | |
  • Hello. Could you include quick information about how this module answers your question? You know, in case of link going down, and to make search easier. – Mołot Aug 22 '14 at 21:20
  • sorry, im going to edit my answer now – CocoSkin Aug 23 '14 at 3:08
  • While this works with the default Drupal image widget, does not work with media browser widget. – No Sssweat Oct 26 '17 at 10:11

The media module should provide a field for entering alt, title, and descriptions for images. If you enter descriptive text in that field whenever you add an image, that should appear as the alt attribute when the content is rendered.

To modify attributes of the field, such at to make it required, edit the field definition:

enter image description here

| improve this answer | |
  • I see the Media module provide field option on "Configuration > Media > File Types > Image > Manage Field", but I dont see the Alt field option. I also see the Alt field option on content type when adding image field, but how can I make it required? – CocoSkin Aug 19 '14 at 21:40
  • You can make it required by managing the fields (structure/file-types/manage/image/fields) and changing the setting on the field. – beth Aug 19 '14 at 22:18
  • 1
    On content type image field, it only allow me to enable the Alt field but does not have the option to make Alt field as required. – CocoSkin Aug 20 '14 at 12:45
  • 1
    Added screenshot to answer. – beth Aug 20 '14 at 15:31
  • I thought the File types you mentioned is content type. Now I see they are different. How you get the File type in Structure? Is it some kind of module? – CocoSkin Aug 20 '14 at 16:13

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.