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

[6.x] Use Dialog for Article links, when "modal option" is selected

Open Fedik opened this issue 1 year ago • 13 comments
trafficstars

Summary of Changes

Use Dialog for Artcile links, when "modal option" is selected.

And new feature: Allow to show inline content in the popup.

Testing Instructions

Add a couple links to the Article, First link: any regular URL. Second link: #my-popup-target. Also add to the article content, following html:

<div class="hidden">
<div id="my-popup-target">
<p class="p-3">Lorem ipsum dolor sit amet, cu vis velit signiferumque, eos no possim mollis facilisi.</p>
</div>
</div>

For both links select option: show in modal.

Got to article view, and click these links.

Actual result BEFORE applying this Pull Request

First link works in BS Modal: Screenshot 2023-12-03_17-59-26 Second link does nothing.

Expected result AFTER applying this Pull Request

First link works with Joomla Dialog: Screenshot 2023-12-04_11-07-49

Second link works with Joomla Dialog: Screenshot 2023-12-04_11-21-21

Link to documentations

Please select:

  • [ ] Documentation link for docs.joomla.org:
  • [ ] No documentation changes for docs.joomla.org needed
  • [ ] Pull Request link for manual.joomla.org: TBD
  • [ ] No documentation changes for manual.joomla.org needed

References:

  • https://github.com/joomla/joomla-cms/pull/40150

Fedik avatar Dec 04 '23 09:12 Fedik

Test successfully but can't mark it on issues.joomla.org, get Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 8.1.0".

fgsw avatar Dec 09 '23 10:12 fgsw

I have tested this item :white_check_mark: successfully on 7801a6a05aaab37c726598f547ef047aeedb5eac


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

Quy avatar Dec 10 '23 15:12 Quy

RTC


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

Quy avatar Dec 10 '23 15:12 Quy

Thank you @Fedik for this nice work!

A direct change of the modal option for the links in article could lead to broken styles and functions in the frontend for some users in conjunction with a Cassiopeia child template, for example. If a template uses the bootstrap modal events with custom javascript to perform another action when opening or closing, this will unexpectedly stop working. Similarly, custom styles for the modals have to be rewritten from the users and custom css for this purpose will unexpectedly not work anymore.

Perhaps another select option for the new dialog would be a variant to prevent this. And the deprecation of the BS modal in the frontend for the article links could be the long-term solution.

What do you think about this? Would be glad to hear further opinions as well.

LadySolveig avatar Jan 05 '24 11:01 LadySolveig

I can do another option, it is not a problem for me. But I have seen that current modal option looks bad anyway.

What other thinks? :)

Fedik avatar Jan 05 '24 17:01 Fedik

On second thought, another "modal" option will be very confusing, we can probably close it and keep BS here, or rebase to 6-dev

Fedik avatar Jan 06 '24 09:01 Fedik

On second thought, another "modal" option will be very confusing

That's exactly what bothers me a little. But I think the new dialog looks much better by default even without adjusting the css. And can be used out of the box with a template that ships no bootstrap. Tricky :) I will try if I can get a few more opinions on this.

LadySolveig avatar Jan 06 '24 12:01 LadySolveig

@Fedik thank you for your work. We decided to rebase to 6

LadySolveig avatar Jan 11 '24 20:01 LadySolveig

Can you please make the requested change, so that we can test this during PBF? Then we can already merge this into 6.0.

Hackwar avatar Feb 21 '24 09:02 Hackwar

I have tested this item :white_check_mark: successfully on b1872fffd9f20733fcafdb2146154aa2c6f9d0bc


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

SarahBerryman12 avatar Feb 24 '24 15:02 SarahBerryman12

I have tested this item :white_check_mark: successfully on b1872fffd9f20733fcafdb2146154aa2c6f9d0bc


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

eddiekonczal avatar Feb 24 '24 15:02 eddiekonczal

RTC


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

richard67 avatar Feb 24 '24 16:02 richard67

How can this have been tested with 6.x

brianteeman avatar Feb 24 '24 16:02 brianteeman

@brianteeman the pr was made against the 6.0-dev branch. This is the branch where we commit all the changes which should go into 6.0.

laoneo avatar Feb 26 '24 14:02 laoneo