Problem/Motivation
Iframe elements need a title attribute for accessibility.
Currently this module doesn't provide any kind of title attribute. It's not very easy to use for example, the media entity name as the title because the template doesn't know about it.
Steps to reproduce
Just use the module and inspect the iframe element generated by this module and you'll notice there is no title attribute.
Proposed resolution
* Let the template know about the media entity name and try to use it as a title.
* Provide a default value if the title is empty (for some reason).
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | media_entity_dreambroker-iframe-title-3415554-6.patch | 3.57 KB | hartsak |
| #2 | media_entity_dreambroker-iframe-title-3415554-1.patch | 3.78 KB | hartsak |
Issue fork media_entity_dreambroker-3415554
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
hartsak commentedHere's a simple patch for starters. Trying to use the media entity label for the title and providing a default value "Video" (translatable).
Also, noticed some problems in tests (unrelated) and tried to fix them too.
Comment #3
kekkisThanks for posting the issue! I happen to know of a solution that is already in use: https://github.com/Tampere/tampere-fi/blob/main/patches/media_entity_dre...
We could combine these approaches maybe?
Comment #4
kekkisComment #5
hartsak commentedOh, you were fast! Nice that you have taken into account the translations too, I completely forgot about them.
I can test your approach too and provide a new patch.
Comment #6
hartsak commentedOk, here's another try. I tried to combine your patch with mine. Hopefully I didn't mess up something there...
And by the way, how to use the latest version in tests? Now it seems only "media_entity_dreambroker 8.x-1.x-dev" is available in the "Test with" drop-down?
Comment #7
kekkisThanks for the patch. The testing configuration is not up to date in this project, we should add a gitlab setup to get access to testing again.
Comment #9
kekkisI tried adding test support using Gitlab CI in #3481075 but seems I ran out of competence and/or time. Will need to dive deeper into that at some point.
However, I would like to propose that we merge this and release it as part of the 2.1.1 release which is also going to introduce basic Drupal 11 support, albeit not for the tests.
Opinions for or against?
Comment #10
hartsak commentedI haven't had any issues with the patch from #6, so I'm not against committing it to the module!
If it was officially committed to the module I wouldn't have to be using the patch.
Comment #11
kekkisComment #12
kekkisComment #14
kekkis