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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jhodgdon’s picture

Status: Active » Postponed
Related issues: +#2091337: Update hook_help for Image module

This 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.

mgifford’s picture

This 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.

jhodgdon’s picture

Yes, 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.

mgifford’s picture

@jhodgdon standards are a pain to get agreement on. I'll try to stick within About & Uses if I can. Thanks!

mgifford’s picture

Issue tags: +TwinCities
mgifford’s picture

Status: Postponed » Active
Issue tags: -TwinCities +TCDrupal 2014
mgifford’s picture

Status: Active » Needs review
FileSize
1.57 KB

@jhodgdon I've added a variation of your suggestion in #1.

Status: Needs review » Needs work

The last submitted patch, 7: image-help-text-atag-2308549-7.patch, failed testing.

mgifford’s picture

Status: Needs work » Needs review
FileSize
1.57 KB

arg..

mgifford’s picture

Sorry for the noise.

mgifford’s picture

The last submitted patch, 10: image-help-text-atag-2308549-10.patch, failed testing.

jhodgdon’s picture

This 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?

mgifford’s picture

In 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

jhodgdon’s picture

OK, 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.

mgifford’s picture

Hope this is clearer. Thanks!

jhodgdon’s picture

Status: Needs review » Needs work

Oops -- dd tag in there twice:

'<dd>' . t('<dd>

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.

mgifford’s picture

Oops..

I also made a small change to the last sentence:

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 DISABLE title text.

jhodgdon’s picture

Should 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?

mgifford’s picture

Status: Needs work » Needs review
FileSize
1.47 KB

Dropped 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.

jhodgdon’s picture

Status: Needs review » Needs work

OK, 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.

mgifford’s picture

Status: Needs work » Needs review
FileSize
3.31 KB

Good suggestions. I used your last sentence. Also made the changes to the fieldSettingsForm().

Status: Needs review » Needs work

The last submitted patch, 22: image-help-text-atag-2308549-22.patch, failed testing.

mgifford’s picture

Status: Needs work » Needs review
FileSize
0 bytes

arg.. quotes..

mgifford’s picture

oops..

mgifford’s picture

Screenshot of the field settings change.

Screenshot of image field.

jhodgdon’s picture

Status: Needs review » Needs work

This is looking good!

A few details to take care of:
a)

      $output .= '</dl>';
+      $output .= '<dt>' . t('Configuring image fields for accessibility') . '</dt>';
+      $output .= '<dd>' . t('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 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.') . '</dd>';
+      $output .= '</dl>';

There are two </dl> tags now. oops.

b) You've misspelled recommended in several places in the UI updates as "reccomended".

mgifford’s picture

Status: Needs work » Needs review
FileSize
3.55 KB

Good catches! Thanks. I can't spell all that well. Thus my interest in fixing examples in code #2329703: [meta] Spellchecking Drupal..

jhodgdon’s picture

OK, 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?

mgifford’s picture

That's more consistent and makes sense to me.

jhodgdon’s picture

Status: Needs review » Reviewed & tested by the community

OK, seems like we're both happy with the text now. Thanks for all the patches!

mgifford’s picture

Thanks for all the great feedback!

The last submitted patch, 18: image-help-text-atag-2308549-18.patch, failed testing.

alexpott’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs reroll
mgifford’s picture

Status: Needs work » Needs review
FileSize
3.55 KB
jhodgdon’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: -Needs reroll

Thanks!

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 35: image-help-text-atag-2308549-35.patch, failed testing.

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 35: image-help-text-atag-2308549-35.patch, failed testing.

mgifford’s picture

bit baffled how this patch can produce 10,431 fail(s)..

jhodgdon’s picture

Click "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?

mgifford’s picture

Ya, it was a heavy load day today.. It's easy to retest it later.

Status: Needs work » Needs review
mgifford’s picture

Status: Needs review » Reviewed & tested by the community

ok, back to rtbc.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed af221c8 and pushed to 8.0.x. Thanks!

  • alexpott committed af221c8 on 8.0.x
    Issue #2308549 by mgifford: Added Document accessibility features in...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.