Allow editors to set null text by replacing a keyword.

Created on 3 June 2024, 6 months ago

Problem/Motivation and Proposed resolution

Thoughts on the setting above? It will make it so content editors can choose if something should be decorative by entering a word.
Instead of me excluding css markup since they might change their mind later.

So basically I as an editor could decide what any word but maybe preference given to "placeholder, decorative" and others will remove the alt text make it blank and remove that check.
Not sure there be another better way than suppressing the text on it loads with it but I'm open to suggestions.

✨ Feature request
Status

Closed: works as designed

Version

2.1

Component

Feature and test requests

Created by

πŸ‡ΊπŸ‡ΈUnited States bernardm28 Tennessee

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @bernardm28
  • πŸ‡ΊπŸ‡ΈUnited States bernardm28 Tennessee
  • πŸ‡ΊπŸ‡ΈUnited States bernardm28 Tennessee

    This probably comes with it's own challenges but will allow an override for those images an ambitious site builder deems decorative.

  • πŸ‡ΊπŸ‡ΈUnited States itmaybejj

    Hi Bernard,

    Have you played with Decorative Image Widget β†’ ? That might fit your needs for the content editing side.

    There is not a connection between the two, though -- the widget lets the author mark the image as decorative, but Editoria11y still asks them to confirm that the decision is OK once the image is in context on the page.

    I do not have an exposed setting to remove that second check, but one could disable that second check by setting an ignore selector like img[alt=""].

  • πŸ‡ΊπŸ‡ΈUnited States bernardm28 Tennessee

    Ooooh, that's a great suggestion and a pretty cool module.
    Though we already do something similar, in a slightly different way.

    My issue is mostly around providing a way where we don't have to do img[alt=""], because a given image might need the warning in the future. Some components change their requirements as they serve a slightly different purpose.
    I thought about a setting any given editor could toggle through a keyword or similar. Similar to the module above but with an Editoria11y exposed setting.
    Editors can choose if the image in that location is decorative but if at a later point, it's not. They could remove the check or keyword and provide a way for Editoria11y to parse it again. That would be ideal.

    I was using 'img[src*=".svg"], img[src*=".png"]' to ignore the extension, but I'm pretty sure editors will change their mind and have a png or .svg at some point that need the alt text warning even though it might not need it today.

    That said, it's ok if you feel that's outside the current scope.

    I will run through a few prototypes and see if I find something that might fit.

  • πŸ‡ΊπŸ‡ΈUnited States itmaybejj

    Yeah I don't think I want to support this directly because it makes me nervous about the future of the data. E.g., uninstall the module and now you have images all over the site with a meaningless string in the alt field being printed to the frontend. Better to just write a good alt the first time, and treat a missing alt as incomplete content. Really very few images should be marked decorative.

    That said-----you can select directly against the alt attribute itself in the ignore selectors: [alt="technical debt"]

  • Status changed to Closed: works as designed 6 months ago
  • πŸ‡ΊπŸ‡ΈUnited States itmaybejj
Production build 0.71.5 2024