Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I don't want the alternative text to images to be required to add an image with ckeditor.
Is there a possiblity to make it optional ? Or maybe to set a default value ?
Comment | File | Size | Author |
---|---|---|---|
#9 | Screen Shot 2017-03-03 at 18.12.43.png | 50.89 KB | Wim Leers |
#2 | alternative_image_text-2855628-2.patch | 945 bytes | saurabh rawat |
Comments
Comment #2
saurabh rawat CreditAttribution: saurabh rawat as a volunteer commentedyou can apply this patch if you don't want to add alt text to an iamge in ckeditor.
Comment #3
saurabh rawat CreditAttribution: saurabh rawat as a volunteer commentedComment #4
saurabh rawat CreditAttribution: saurabh rawat as a volunteer commentedI think you can apply this patch and it will fix your issue.
Comment #5
cilefen CreditAttribution: cilefen commentedActually the right way would be a form alter implementation.
Comment #6
usethe23 CreditAttribution: usethe23 commentedThank you for your help, it works fine. but i'm not sure if this is the right way to do it like @cilefen said.
Comment #7
saurabh rawat CreditAttribution: saurabh rawat as a volunteer commented#6, you can also use below custom code to override the attributes of editor.
Make a custom module and write below code in .module file .
<?php
function form_overwrite_form_alter(&$form, &$form_state, $form_id) {
if ($form_id == 'editor_image_dialog' ) {
$form['attributes']['alt']['#required'] = FALSE;
}
}
Comment #8
usethe23 CreditAttribution: usethe23 commentedThank you saurabh rawat it works ! Thank you for your help !
Comment #9
Wim LeersEh…
The solution is right there ;) Enter
""
.Also, blind users will curse you.
Comment #10
cilefen CreditAttribution: cilefen commentedWim, good point on the helpful error text! I did not know it says that.
Comment #12
localnetwork CreditAttribution: localnetwork as a volunteer and commentedComment #13
hehongbo CreditAttribution: hehongbo commentedWhat I'm more concerned about is not cursed by blind people, but a group of content editors writes variants of useless stuff in the "Alternative Text" field. We often run into situations when we have to put a lot of content on our website in a short amount of time and get a lot of content editors involved to do this together. Many of them write paired quotes
“”
instead of""
because we are working in zh-hans and probably their input methods did that, and some of them write random stuff like1
,aaa
,123
. It makes me feels bad when looking through our database that I want to shut it down immediately.I know Drupal is a platform where accessibility is a thing but in many cases people don't want to spend time on a field that is invisible if they're in a rush, and emphasize the importance of accessibility by technically making this field "required" is probably not a good thing.