User tests: Successful: Unsuccessful:
Pull Request is a continuation of #37008, #36613 and #35780
Check the images render as expected
I didn't touch the mod_banners/tmpl/default.php
but that one should also be patched
Status | New | ⇒ | Pending |
Category | ⇒ | Front End com_content com_finder com_tags com_users Modules |
Labels |
Added:
?
|
Somehow I find it strange that we can't write a simple image tag anymore in core.
Easily fixable:
loading=lazy
and it would be like 2010
2010 was not bad, less complicated as now
2010 was not bad, less complicated as now
?
I mean you can remove the complicated JLayout and add the same functionality in the sef.php plugin. BUT there's a performance cost, with the JLayout approach you run the code only for images using the media field but with the sef plugin you will run that code for each and every image in the HTML. And since for me User Experience is more beneficial than Developer's experience/convenience thus this PR. The project could very easily destroy any meaningful SEO/ROI by executing code repeatedly for cases that is not required but then again will keep devs that think it's awkward to cater themselves for the output of their code very happy. Not up to me to decide, I just proposed what seems reasonable by my own standards. Feel free to close this and add the code in the sef.php...
I still would prefere to implement the layout properly in HTMLHelper::image
and use this everywhere, it's much more convenient
I still would prefere to implement the layout properly in HTMLHelper::image and use this everywhere, it's much more convenient
Probably I would also agreed with this if the HTMLHelper::image
had more friendly/memorable arguments:
/**
* Write a `<img>` element
*
* @param string $file The relative or absolute URL to use for the src attribute.
* @param string $alt The alt text.
* @param array|string $attribs Attributes to be added to the `<img>` element
* @param boolean $relative Flag if the path to the file is relative to the /media folder (and searches in template).
* @param integer $returnPath Defines the return value for the method:
* -1: Returns a `<img>` tag without looking for relative files
* 0: Returns a `<img>` tag while searching for relative files
* 1: Returns the file path to the image while searching for relative files
*
* @return string|null HTML markup for the image, relative path to the image, or null if path is to be returned but image is not found
*
* @since 1.5
*/
But that last integer it's a very good lesson for new devs how NOT to assign arguments on a function
Then again this is just code and someone could maybe fix this in a B/C way (we did that for the script/stylesheet functions somewhere around 3.5). That said I still believe the JLayout is the right API for echoing HTML fragments, it's what the project uses everywhere else (all bootstrap, fields, XTDButtons, etc)
I have tested this item
Images are well rendered, i have tested feeds too!
I have tested this item
I have tested this item
RTC
Status | Pending | ⇒ | Ready to Commit |
Labels |
Added:
?
|
Status | Ready to Commit | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2022-02-25 15:53:16 |
Closed_By | ⇒ | laoneo |
Thanks!
Nice, thanks!
I have tested this item
Tested all views
Somehow I find it strange that we can't write a simple image tag anymore in core.