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.
I think the title explains all.
Comment | File | Size | Author |
---|---|---|---|
#10 | alt_attribute_to_thumbnail-1926872-10.patch | 2.57 KB | diego21 |
#8 | alt_attribute_to_thumbnail-1926872-8.patch | 2.91 KB | diego21 |
#6 | alt_attribute_to_thumbnail-1926872-6.patch | 944 bytes | diego21 |
Comments
Comment #1
sartogo CreditAttribution: sartogo commentedBump for this. Really need the ability to set the alt tag based on video attributes (at least default to video title for now so html can validate). This should also work on views.
Thanks for the great work!
Comment #2
omar.mcknz@gmail.com CreditAttribution: omar.mcknz@gmail.com commentedAgreed.
Comment #3
btown CreditAttribution: btown commentedI'll second this. For accessibility purposes, this is a must.
Comment #4
superdorx CreditAttribution: superdorx commentedAgreed
Comment #5
mgiffordI'm changing the title. Ultimately, Alt tags are more useful for accessibility than titles. There is a strong precedent for this in Core.
Comment #6
diego21 CreditAttribution: diego21 commentedSimple patch to add this feature.
Comment #7
plopeschey diego21
Thank you for your patch. It solves the problem fine in case you select the thumbnail formatter, but would be great if you could also gice this support in case you enable the colorbox module and select the 'Thumbnail Preview w/Colorbox' formatter.
Then you should play with the
video_embed_field_colorbox_code
theme callback to add there a new#image_alt
property.If you need some feedback, please ping me on IRC
Comment #8
diego21 CreditAttribution: diego21 commentedThanks @plopesc :-)
I think that now is ok.
Comment #9
plopescHey @diego21, grea twork here
Your patch looks pretty good. I just have a question about this line:
I think this line is not necessary here,
video_embed_field_embed_code
theme callback is related to the video player, and we are dealing with image thumbnails in this patch.Could you confirm me that this line is not used anywhere and could be removed?
Thank you
Comment #10
diego21 CreditAttribution: diego21 commentedFixed.
You are right, that line is not necessary. Indeed, the hook_theme() wasn't difining that variable for video_embed_field display :-)
Thanks for the comment.
Comment #11
diego21 CreditAttribution: diego21 commentedComment #13
plopescCommitted and pushed to 7.x-2.x
Thank you @diego21!!
Comment #15
llribas CreditAttribution: llribas commentedSorry,
I also need the alt text when you select "Thumbnail preview" as the field formatter, but I can't find the option for this!
I installed the last 7.x-2.x-dev and also 7.x-2.0-beta11, but I can't find the option for a tokenized or default alt text, maybe I'm looking for it in the wrong place, I spect it in:
Content types » Article » Manage display
and when I select "Thumbnail preview" for the video field, I expected to find something in the field configuration.
Where are these new options for thumbnails alt text?
thank you
Comment #16
llribas CreditAttribution: llribas commentedOk, as I see you need to activate the "Description" for the video field, then, the text in the "Description" is used as "alt text" when you use the "Thumbnail preview" formatter.
But:
1. If you use "views" to display the field, you can't choose to "hide" the "description", and it's always displayed after the thumbnail (but the alt text in the thumbnail image is inserted fine).
2. In the formatter options, if you choose to not show the description, then the text in the description is not used to fill the "alt text" for the thumbnail image, so the "alt text" is empty. Then, you only get the "alt text" filled with the "description" text if you choose to "show description" (at the top or the bottom of the image), and this looks repetitive for SEO purposes.
I think it should always include the "alt text" (also if you choose to "hide" the description), and have the option to also choose how to display it in views settings.
Thank you
Comment #17
dak5859 CreditAttribution: dak5859 commentedDoes anyone on this thread know if a solution for this issue has been provided for the use of the Video Embed field in D8 core media module video type? We have a view that's showing video items and the thumbnail image for the video does not have alt text. Any help with this issue would be greatly appreciated (e.g. the patch used for D7 version of Video Embed in this thread).