joomla-cms icon indicating copy to clipboard operation
joomla-cms copied to clipboard

[5.1] Replace hard coded img element by JLayout joomla.html.image and DRY

Open hans2103 opened this issue 1 year ago • 6 comments

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

hans2103 avatar Dec 13 '23 14:12 hans2103

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.

Quy avatar Dec 15 '23 04:12 Quy

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.

brianteeman avatar Dec 15 '23 12:12 brianteeman

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.

hans2103 avatar Jan 03 '24 12:01 hans2103

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.

ufuk-avcu avatar Feb 24 '24 09:02 ufuk-avcu

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/42508.

richard67 avatar Feb 24 '24 10:02 richard67

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.

reDimDev avatar Feb 24 '24 14:02 reDimDev

Thanks

bembelimen avatar Feb 28 '24 21:02 bembelimen