joomla-cms
joomla-cms copied to clipboard
[5.1] Replace hard coded img element by JLayout joomla.html.image and DRY
Pull Request for no Issue This PR replaces https://github.com/joomla/joomla-cms/pull/40618 After solving the merge conflicts there are just too many changed files.
Summary of Changes
This PR will change the hard coded <img src=""... inside the default view of mod_banners by a call to JLayout joomla.html.image and keeps it DRY.
Testing Instructions
- Joomla 5 with testing sample data. (adjust mod_banners config and unset the chosen client, otherwise you don't see images... https://github.com/joomla/joomla-cms/issues/40616)
- Go to frontend index.php/banners
Actual result BEFORE applying this Pull Request
You will see a banner image on the page.
Expected result AFTER applying this Pull Request
You will see a banner image on the page. The same as BEFORE. The HTML output is also the same as BEFORE. The only difference is that it is rendered by JLayout which allows users to create an override.
Link to documentations
Please select:
-
[ ] Documentation link for docs.joomla.org:
-
[X] No documentation changes for docs.joomla.org needed
-
[ ] Pull Request link for manual.joomla.org:
-
[X] No documentation changes for manual.joomla.org needed
I have tested this item :white_check_mark: successfully on a1ba0fa035e59597d5fd94e52529ee700bcc208c
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/42508.
The only difference is that it is rendered by JLayout which allows users to create an override.
Am I being daft here but you could always create an override for the module output. But now if you want to create an override then it will impact not just the image layout in the module but everywhere that the image layout is being used.
The only difference is that it is rendered by JLayout which allows users to create an override.
Am I being daft here but you could always create an override for the module output. But now if you want to create an override then it will impact not just the image layout in the module but everywhere that the image layout is being used.
isn't that great? The JLayout perfect spot to implement a cdn for images. It is up to the JLayout how images should be rendered, not the module. The module should forward the information to the JLayout to render the image.
I have tested this item :white_check_mark: successfully on a1ba0fa035e59597d5fd94e52529ee700bcc208c
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/42508.
RTC
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/42508.
I have tested this item :white_check_mark: successfully on 0b6155a5be05d4b39bcb27ebf98126d504632ca8
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/42508.
Thanks