In addition to the alt-tag shown in Mark missing embedded entities in WYSIWYG I would like my editors to see something like "Deleted content" via mouse over.
The alt tag is only shown to screen readers and if the image is missing (but we are sure that no-thumbnail.png exists).
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | entity-embed-missing-entity-title-3019308-3.patch | 2.09 KB | oknate |
| #2 | entity_embed--missing-embedded-entities-title.patch | 1.02 KB | gngn |
Comments
Comment #2
gngn commentedComment #3
oknateI can mark #2 RTBC. The text added shows when hovering over the image.
But I have a few issues with the text displayed. I'm not sure why we need to change it from the alt text. Couldn't we use the same text?
Also, a few side notes:
1) I don't think we should hard-code height and width attributes on the image. The image used is natively 180x180.
2) Additionally, I think we should add a class so that themers can adjust the size if they like. For example, on retina screens, I think 90x90 looks good.
3) Some times entities fail to load for other reasons than the entity having been deleted. I propose changing the text to something more generic such as "Content not found". It could potentially be confusing for editors who think content is being deleted, when in fact, there's some other type of error that is causing it to fail loading.
I'm adding an alternate patch that removes the width and height attributes, adds a class and changes the verbiage.
Comment #4
gngn commentedI thought that height and width are required attributes. But you're right, they are not.
CSS class is useful and I think your text is OK.
Comment #5
wim leersWe need to.
widthandheightattributes on images are essential for fast rendering performance in browsers; otherwise they need to reflow everything they've rendered once the images arrive.In the future, we probably want to replace this with a customizable template. Right now, to swap out the "no thumbnail" image, you'd have to create a new
@Filterplugin.And if we turn this into a template, adding classes for themers becomes very easy to do.
So let's instead of doing #3 create a new issue to use a template rather than hardcoded HTML for deleted content.
\Drupal\filter\Plugin\Filter\FilterCaptionalready contains an example for this.Meanwhile, I'm going ahead and committing #2.
Comment #6
wim leersComment #7
wim leersComment #9
wim leersTagging for follow-up issue to introduce a template per #5.