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).

Comments

gngn created an issue. See original summary.

gngn’s picture

Issue summary: View changes
Status: Active » Needs review
StatusFileSize
new1.02 KB
oknate’s picture

I 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.

gngn’s picture

I 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.

wim leers’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: +DX (Developer Experience)

I don't think we should hard-code height and width attributes on the image. The image used is natively 180x180.

We need to. width and height attributes 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 @Filter plugin.

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\FilterCaption already contains an example for this.

Meanwhile, I'm going ahead and committing #2.

wim leers’s picture

Title: Show title tag for missing entities » Follow-up for #2982322: set `title` attribute for missing entities, to provide useful information upon mouseover
Issue tags: -DX (Developer Experience) +Usability
wim leers’s picture

Status: Reviewed & tested by the community » Fixed

  • Wim Leers committed 0a7db18 on 8.x-1.x authored by gngn
    Issue #3019308 by gngn, oknate, Wim Leers: Follow-up for #2982322: set `...
wim leers’s picture

Issue tags: +Needs followup

Tagging for follow-up issue to introduce a template per #5.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.