silverstripe-asset-admin
silverstripe-asset-admin copied to clipboard
The Title field on images should let the user know it is being used for the ALT attribute.
The Title field on Images, not added via the WYSIWYG, is being used for the ALT attribute on images. However, there is no description stating this. There should be a tooltip on the field, if it is an image, stating that the Field will be used for the ALT attribute or something similar.
😞 this was fixed for the WYSIWYG but never fixed for files from the UploadField.
I don't really like the idea that the title field should be passed to the alt attribute. Alt text won't always easily translate from a file title, and changing the file title so that it provides good alt text content wouldn't be that intuitive, e.g. <img src=”tui-eating.jpg” alt="A Tui (bird) standing on a branch eating a berry” title=”Tui eating”/>
.
The other option would be adding an alt text field in the CMS for all images stored in the Files area. I'm not sure that it's entirely clear to users that changing the contents of that field would apply to every page where the file is used - but I feel like there's a better chance of getting the right values recorded.
What do you think @clarkepaul ?
Agree there should be an additional field so that the ALT information is independent from the title field. Prefer if it can be updated at the placement level (not on the original file). Other CMS's often have a SEO/Accessibility section with fields relating to that, which this seems to fit quite well into. It could inherit the title text but probably doesn't need to.
For WYSIWYG images we have a whole Placement tab which we don't have in this instance. So would be useful to have some mockups for ways of presenting this info.
For the time being, I have created a module that adds an alt text field to the image asset: https://github.com/purplespider/silverstripe-asset-alt-text
@purplespider - I like the idea of your module - 'll surely check it out! Opposed to what @clarkepaul said I think it's important, that it inherits a value with the downside, that an image just has one single alt-value in every instance. I consider sane defaults based on filename more valuable than the flexibility of having different values per instance - think of an Image-Gallery for example. It would complicate authoring experience and in praxis we end up with a lot of empty alt-tags. Fields on placement level are also less easy to customize. Anyway, wouldn't this be a breaking change? The module approach feels more flexible to me.
Not opposed to having the Alt field within the main Details panel, provides the majority of the value to users for sure and a lot easier to manage. Was just thinking from an accessibility point of view that the ALT text used in one scenario might not be what you'd use in another.
@purplespider Does the original file ALT text populate the placement ALT field when adding images via the WYSIWYG? maybe you have removed it from the placement tab for files.
If it carries through to the placement tab, what happens if it is edited in the placement tab?
Not opposed to having the Alt field within the main Details panel, provides the majority of the value to users for sure and a lot easier to manage. Was just thinking from an accessibility point of view that the ALT text used in one scenario might not be what you'd use in another.
Completely agree that the correct approach would be for alt text to be associated with the placement of the image rather than the image itself. Was thinking maybe a field type that included an UploadField
and TextField
grouped together. My module was simply created as a quick stop-gap.
Does the original file ALT text populate the placement ALT field when adding images via the WYSIWYG?
Yes, it does. (but not deliberately!)
maybe you have removed it from the placement tab for files.
I didn't do any specific work in this area, but I did test how my module would affect WYSIWYG alt text.
If it carries through to the placement tab, what happens if it is edited in the placement tab?
If an image has Alt text, when you go to add an image in a WYSIWYG, the Alternative text
field automatically populates with the image's alt text. You can edit it if you wish, and it uses the edited alt text in the WYSIWYG but doesn't update the original image's alt text.
The only slight area of clunkiness is after inserting an image with edited alt text, if you click to Edit the image, the placement alt text field shows the original image's alt text, and not the edited placement alt text. So if you "Update" it would override the edited alt text for that placement. However, I don't believe this is related to my module, as the same thing happens without the module installed, except the previous alt text gets removed, as when editing an image the alt text field doesn't populate with any existing alt text, so is always empty. As mentioned, I didn't do any work in this area and believe it only pre-populates the placement alt text because my module uses the same field name as the placement field name.
if you click to Edit the image, the placement alt text field shows the original image's alt text, and not the edited placement alt text.
A total guess, @purplespider, but this might be related to an issue that was recently resolved in 1.7.x and 1.8.x of silverstripe/asset-admin. See: https://github.com/silverstripe/silverstripe-asset-admin/pull/1213
this might be related to an issue that was recently resolved in 1.7.x and 1.8.x of silverstripe/asset-admin. See: #1213
@brynwhyman Yep, looks like you're right! I just tested my module with v1.8.3 of asset-admin and am pleased to report it now all works as you'd expect.
The placement alt text field still pre-populates from the asset alt text. If you change it, insert the image, then edit the image placement, the field correctly shows the edited text, so it no longer reverts edited placement alt text on updating an image.
Closing as based on comments seems as if it was fixed by https://github.com/silverstripe/silverstripe-asset-admin/pull/1213
@emteknetnz While the issue mentioned in the previous 3 comments has been fixed (when using my module, modified placement alt text no longer gets overridden upon updating the placement.) I don't believe there has been any progress on the original issue of providing a better way to deal with alt text than using the Title field. (Unless my module has been regarded as the solution?)