Removal of an orphaned "alt"#32587
Removal of an orphaned "alt"#32587infograf768 merged 1 commit intojoomla:4.0-devfrom ahotzler:4.0-dev
Conversation
|
I have tested this item ✅ successfully on ea3c2a0 Question though for @dgrammatiko regarding the changes in #30784 that led to this.
So much looked to go on in #30784 this might have been something overlooked. Another PR would be needed as a result to modify line 26 to change the generation of $alt and further change the implementation of $images->image_fulltext_alt_empty which then becomes redundant as the fallback will always be alt="" if there's no alt text. This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/32587. |
That is absolutely the opposite of what should be done. The author must make a conscious decision if an image is decorative or not and if it is not then they must enter a suitable description. You dont make your website accessible by simply ignoring (and therefore hiding) images. Previously Joomla did exactly what you suggest and defaulted to alt="" The problem with that is that its not a conscious decision and perhaps more importantly will pass any accessibility checker so you will never be prompted to fix your site and to make it accessible for all. Responsible web design is making your content available for everyone and not, as in your suggestion, just to those with vision. Please read https://magazine.joomla.org/all-issues/october-2020/an-image-is-worth-a-thousand-words |
|
In summary. If the image is not decorative and you "forget" to add an alt description then no accessibility checker will ever be able to tell you that you "forgot". Hence the bugfix |
|
Can someone tell me what I need to do so that no height/width information is output? I have not discovered a way to do this in the backend. I then created an override, which was the reason why I looked into the code in the first place. |
Actually @brianteeman initiated those changes (if you cared reading the responses on the PR you linked you would have seen it) and I think he's explained it in details also here in the above comments
Override is always the right answer in joomla (adding options is always the wrong one!!!) |
|
Does this really mean that height/width is always output by default and this behavior cannot be turned off via backend? I find the size assignment with these attributes directly in the source code under aspects of the image scaling in certain constelations very obstructive, at least if I can't turn it off. |
YES, the reason is that browsers actually require the exact width and height of any image! It can be disabled by overriding OR when choosing an image deselect the lazyload checkbox (but don't do that, will affect the performance of your site).
Use CSS something like this .someClass {
max-width: 100%;
height: auto;
} |
I search and search, but can't find it. Can you give me a hint where to find the lazyload checkbox? |
Select a new image and check all the options before closing the Modal, it's there |
|
No, there is no such option! |
|
And please dont forget: We are talking about "Full Image", The image selection dialog behaves differently here than when inserting an image normally |
|
For the full image and intro image ALL the changes can be done with an override |
|
Than the comments in the code doesnt make sense |
??? Context? |
|
There is a comment: "// Set lazyloading only for images which have width and height attributes" It suggests that you as a user have a choice, which you don't have with "Full-Image |
As a site visitor you get whatever was decided by the author of the site. |
|
Thanks for updating my POV on it @dgrammatiko and @brianteeman #30874 had so much going on the discussion you're referring to I think might have been in amongst clusters of comments that GitHub closed up while I was trying to find it. I'll go add a note to add concepts of lazyloading and the new alt text features to https://docs.joomla.org/Adding_an_image_to_an_article. Meanwhile, another test is needed to allow this to be merged and take the excess alt out of the rendered code. |
|
Can the PR creator, i.e. me, also test or does that violate guidelines? |
|
the PR creator is supposed to have already tested it |
|
I have tested this item ✅ successfully on ea3c2a0 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/32587. |
|
In fact we already have 2 testers. RTC This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/32587. |
|
Tks. |

Pull Request for Issue # .
Summary of Changes
Removal of an orphaned "alt"
Testing Instructions
Füge ein "Full Image" zu einem Artikel hinzu und schau Dir den HTML Code oder benutze einen Syntax-Checker
Actual result BEFORE applying this Pull Request
Error: Duplicate attribute alt.
'alt="" alt itemprop="'
Expected result AFTER applying this Pull Request
No Error while HTML Syntax Checking
Documentation Changes Required
None