NPM Resource Changed ? Pending

User tests: Successful: Unsuccessful:

avatar chmst
chmst
6 May 2022

Pull Request for Issue #37380 part1 .

Summary of Changes

Images are always wrapped in a figure tag.

Testing Instructions

see #37380 part 1.

Open an article and add images from media. Add mage class, caption, caption class in all variants.

Actual result BEFORE applying this Pull Request

see #37380 part 1.

Expected result AFTER applying this Pull Request

very image has is wrapped i a figure.
All classes are set,
Caption is only set when a caption is entered

Documentation Changes Required

avatar chmst chmst - open - 6 May 2022
avatar chmst chmst - change - 6 May 2022
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 6 May 2022
Category JavaScript Repository NPM Change
avatar dgrammatiko
dgrammatiko - comment - 6 May 2022

@chmst I would change the conditional to:

      if (figClasses) {
         imageElement = `<figure${figClasses}><img src="${Joomla.selectedMediaFile.url}"${classes}${isLazy}${alt} data-path="${Joomla.selectedMediaFile.path}"/>${figCaption ? `<figcaption>${figCaption}</figcaption>` : ''}</figure>`;
       } else {
         imageElement = `<img src="${Joomla.selectedMediaFile.url}"${classes}${isLazy}${alt} data-path="${Joomla.selectedMediaFile.path}"/>`;
       }

In this case a user will get:

  • an image if no figure classes defined
  • a figure around the image if the figure class is defined
    • a fig caption inside the figure if the caption text is defined

Basically it's more flexible than dictating one specific output like you did

You can add one more check box for figure to allow the case that a user wants a figure element without defining any classes (the code is similar to the lazy load checkbox)

avatar chmst
chmst - comment - 6 May 2022

Thanks @dgrammatiko I made this PR so we can discuss.

I am just am working on a site where editors add content. Some images have captions, others don't. I am struggling with the styling, if images are different.

avatar brianteeman
brianteeman - comment - 6 May 2022

The problem is the different options (and results) between using com_media and com_content intro/full images

avatar dgrammatiko
dgrammatiko - comment - 6 May 2022

The problem is the different options (and results) between using com_media and com_content intro/full images

FWIW I think you should first fix the com_content intro/full inputs (as you cannot change the existing inputs, you can only add more) fix the layout to have conditional output of image/figure (that's a mild B/C break) and then port the UI to this selector so things are consistent across the board.

avatar chmst
chmst - comment - 6 May 2022

Sounds like a plan.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/37753.
avatar joomla-bot
joomla-bot - comment - 27 Jun 2022

This pull requests has been automatically converted to the PSR-12 coding standard.

avatar HLeithner HLeithner - change - 27 Jun 2022
Labels Added: NPM Resource Changed ? ?
avatar chmst chmst - change - 23 Oct 2022
Labels Removed: ?
avatar HLeithner
HLeithner - comment - 2 May 2023

This pull request has been automatically rebased to 5.0-dev.

avatar HLeithner
HLeithner - comment - 30 Sep 2023

This pull request has been automatically rebased to 5.1-dev.

avatar crimle crimle - test_item - 24 Feb 2024 - Tested unsuccessfully
avatar crimle
crimle - comment - 24 Feb 2024

I have tested this item ? unsuccessfully on ed76ce1

[Apply Patch] results in error message
«There are no files to patch from this pull request. This may mean that the files in the pull request are not present in your installation.»


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

avatar chmst
chmst - comment - 5 Apr 2024

@crimle This PR is a DRAFT and not ready for a test.

avatar crimle
crimle - comment - 6 Apr 2024

Ok, but it's not always easy to find out what to test. I have a feeling, that the filters of the Joomla! Patch Tester are not always working as they are expected to.

avatar HLeithner
HLeithner - comment - 24 Apr 2024

This pull request has been automatically rebased to 5.2-dev.

avatar HLeithner HLeithner - change - 24 Apr 2024
Title
[4.2] [Draft] Wrap all images in figure
[5.2] [Draft] Wrap all images in figure
avatar HLeithner HLeithner - edited - 24 Apr 2024
avatar HLeithner
HLeithner - comment - 2 Sep 2024

This pull request has been automatically rebased to 5.3-dev.

avatar HLeithner HLeithner - change - 2 Sep 2024
Title
[5.2] [Draft] Wrap all images in figure
[5.3] [Draft] Wrap all images in figure
avatar HLeithner HLeithner - edited - 2 Sep 2024

Add a Comment

Login with GitHub to post a comment