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.
To help author more accessible content (according to ATAG 2.0) adding specific documentation on D8's accessibility will help people learn what is. In ATAG A.4.2 they outline in more detail best practices in "document the user interface, including all accessibility features."
So on the help pages here /admin/help/image we could add a section at the bottom, something like:
<h3>Accessibility</h3>
<p>You can customize the image field to include alternative text and title attributes. Furthermore, both can be set as required fields. </p>
I expect that there are more elements that can be included.
Comment | File | Size | Author |
---|---|---|---|
#35 | image-help-text-atag-2308549-35.patch | 3.55 KB | mgifford |
#30 | image-help-text-atag-2308549-30.patch | 3.54 KB | mgifford |
#28 | image-help-text-atag-2308549-28.patch | 3.55 KB | mgifford |
#26 | Screen Shot 2014-09-25 at 12.37.40 AM.png | 84.59 KB | mgifford |
#25 | image-help-text-atag-2308549-24.patch | 3.31 KB | mgifford |
Comments
Comment #1
jhodgdonThis proposal does not fit with the structure of the hook_help() "About" and "Uses".
Probably this is a "uses" item, since the ATAG guidelines you cite say we should be documenting how content authors can either use accessibility features in the authoring UI, or how any author (with or without limitations in how they use the UI themselves) can set up content to be accessible.
So I think what we need to do is add a new "uses" item... these should start with an -ing verb. How about this:
Configuring image fields for accessibility
For accessibility, all images displayed on web sites should have alternate text; they may also have title text. Image fields can be configured to either allow or require alternate and title text, in the field settings; requiring alternate text is one way of ensuring that all images have alternate text to display. The default image formatter will output any provided alternate and title text in the HTML img tag.
Thoughts?
Also note that the image module help needs an update in general. See
#2091337: Update hook_help for Image module
This issue should probably either be postponed until the other one is done, or incorporated.
Comment #2
mgiffordThis has less to do with hook_help() than it does with the Help text standard (for core and contrib) doesn't it?
My examples haven't been very rich, but for modules that would have more content on accessibility improvements, why be limited to just About" and "Uses"? Having an Accessibility heading isn't a huge deal though.
Figured it is worth adding the handbook page on managing images/media accessibly. As there is already a lot of content about this.
Your text reads way better than mine and it would be a good addition.
Comment #3
jhodgdonYes, it has to do with the standards we've adopted for hook_help(), not hook_help() itself.
If we come up with a module where having a whole new section for Accessibility makes sense, then we can reconsider the standards, but adoption of new coding/docs standards is a very difficult process in the Drupal community. So unless you really have things that fall outside of "About" and "Uses", it would be best to stick with our current standard.
Anyway... of course go ahead and add the text above to any d.o page that it needs to go on.
Comment #4
mgifford@jhodgdon standards are a pain to get agreement on. I'll try to stick within About & Uses if I can. Thanks!
Comment #5
mgiffordComment #6
mgiffordComment #7
mgifford@jhodgdon I've added a variation of your suggestion in #1.
Comment #9
mgiffordarg..
Comment #10
mgiffordSorry for the noise.
Comment #11
mgiffordComment #13
jhodgdonThis looks pretty good, but I'm now confused about whether you are recommending just alt or if using an alt and title both is OK?
Comment #14
mgiffordIn general only alt should be used. It's confusing for screen reader users to have both alt & title, so is generally not recommended.
http://blog.silktide.com/2013/01/i-thought-title-text-improved-accessibi...
http://webaim.org/articles/gonewild/#title
Comment #15
jhodgdonOK, maybe this can be rewritten a bit to stress this then? Also "who" referring to screen readers is a bit weird in that sentence; should be "which" and preceded by a comma.
Comment #16
mgiffordHope this is clearer. Thanks!
Comment #17
jhodgdonOops -- dd tag in there twice:
I also think this can be written more efficiently. How about this:
For accessibility and search engine optimization, all images that convey meaning on web sites should have alternate text. Drupal also allows entry of title text for images, but it can lead to confusion for screen reader users and its use is not recommended. Image fields can be configured to either allow or require alternate and title text, in the field settings; the recommended settings is to require alternate text and disallow title text.
Comment #18
mgiffordOops..
I also made a small change to the last sentence:
Comment #19
jhodgdonShould be "... recommended setting is to ..." not settings? Also, we should use the same terminology (enable/disable, or allow/disallow) that is used in the UI for these settings. Have you looked at that and made sure they match?
Comment #20
mgiffordDropped the 's' - thanks.
However, enable/disable and allow/disallow aren't interchangeable.
You enable/disable a configuration setting.
You allow/disallow a user's access.
I didn't see any conflicts in the UI of the image.module's help.
Comment #21
jhodgdonOK, we're nearly there!
So... "to either allow or require alternate and title text" implies that there are two choices: (a) allow and (b) require, whereas there is actually a third choice, (c) do not allow at all.
Also, I checked in the UI. The settings for whether the alt/title are even allowed are called "Enable ... field" and the settings for whether they are required are called "... field required".
So here is a proposed rewrite of the last sentence:
Image fields can be configured so that alternate and title text fields are enabled or disabled; if enabled, the fields can be set to be required. The recommended setting is to enable and require alternate text and disable title text.
I also think that this information should be added to the field settings form itself. This is in
\Drupal\image\Plugin\Field\FieldType\ImageItem::fieldSettingsForm().
Having it in the hook_help() is OK, but this information will not necessarily be getting to people who are actually setting up fields.
Comment #22
mgiffordGood suggestions. I used your last sentence. Also made the changes to the fieldSettingsForm().
Comment #24
mgiffordarg.. quotes..
Comment #25
mgiffordoops..
Comment #26
mgiffordScreenshot of the field settings change.
Comment #27
jhodgdonThis is looking good!
A few details to take care of:
a)
There are two </dl> tags now. oops.
b) You've misspelled recommended in several places in the UI updates as "reccomended".
Comment #28
mgiffordGood catches! Thanks. I can't spell all that well. Thus my interest in fixing examples in code #2329703: [meta] Spellchecking Drupal..
Comment #29
jhodgdonOK, it all looks good now... hm. One last thing I noticed (sorry for not noticing it earlier). The two "alt" fields have descriptions like "It is recommended to ...", while the "title" field says "Enabling this field is not recommended...". We should probably make them more parallel; I think I prefer the "title" wording? So we could say "Enabling this field is recommended" and "Making this field required is recommended" for the alt fields? Thoughts?
Comment #30
mgiffordThat's more consistent and makes sense to me.
Comment #31
jhodgdonOK, seems like we're both happy with the text now. Thanks for all the patches!
Comment #32
mgiffordThanks for all the great feedback!
Comment #34
alexpottComment #35
mgiffordComment #36
jhodgdonThanks!
Comment #40
mgiffordbit baffled how this patch can produce 10,431 fail(s)..
Comment #41
jhodgdonClick "View" to see the results, and expand one of the items. There's some kind of problem with the test bots. They're running out of PDO database connections. Try again in a few hours, maybe it will be fixed?
Comment #42
mgiffordYa, it was a heavy load day today.. It's easy to retest it later.
Comment #44
mgiffordok, back to rtbc.
Comment #45
alexpottCommitted af221c8 and pushed to 8.0.x. Thanks!