enonic/app-contentstudio

Enable marking image as decorative in the Insert Image dialog

Closed this issue · 0 comments

https://www.w3.org/WAI/tutorials/images/decorative/

Replace "Alternative text" input with a radio group with "Accessibility" label and two radio buttons:

  • Decorative image
  • Alternative text, with a text input underneath

One of the two options must be selected to insert an image. If "Alternative text" is selected, user must fill in value in the text input (make sure to trim the value before validating).

If "Decorative image" is selected, add "alt" attribute with an empty value (alt="") to the img element.
If "Alternative text" is selected, add "alt" attribute with the value from the text input (make sure to trim).

For an existing image presence (or absence) and value of "alt" attribute will determine which of the radio buttons will be preselected.

Remember to localise all the new texts.

image