avatar Mat-o
Mat-o
30 Aug 2021

It is usefull sometimes to be able to write simple html links opening in a modal, without php, directly in articles.
With Joomla 3.9, this used to work very efficiently :

  • add the class "modal"
  • add a "rel" attribute, defining the size and the handler...

and a simple modal window would open, displaying the content of the href link (no iframe : the content was pulled and displayed in ajax). It could be a Joomla article, or even an external link. No need for an extension.
Now these link are broken after the update from 3.9.28 to 3.10.1 : is there a new syntax I should use ?

Steps to reproduce the issue

1 - create a link :
<a class="modal" href="index.php?xxxxxxx&tmpl=component" rel="{handler: 'iframe', size: {x: 600, y: 450}}">Open modal</a>

Expected result

Opens modal.

Actual result

Does no open modal since updating to 3.10.x

System information (as much as possible)

Joomla 3.10.0 after update from 3.9.28.
php 7.4, apache 2.4 + nginx as proxy-cache, Mysql 5.7.
All browsers behave the same way.

Additional comments

It seems the mootools library was taking care of this, but maybe it has been deprecated now.
Does the syntax above miss a data-attribute, or a change in the class name ?
Or is there a whole new way to open modals ?

Thank you for making Joomla !

[edit : formating]

avatar Mat-o Mat-o - open - 30 Aug 2021
avatar Mat-o Mat-o - change - 30 Aug 2021
The description was changed
avatar Mat-o Mat-o - edited - 30 Aug 2021
avatar Mat-o Mat-o - change - 30 Aug 2021
The description was changed
avatar Mat-o Mat-o - edited - 30 Aug 2021
avatar Mat-o Mat-o - change - 30 Aug 2021
The description was changed
avatar Mat-o Mat-o - edited - 30 Aug 2021
avatar Mat-o Mat-o - change - 30 Aug 2021
The description was changed
avatar Mat-o Mat-o - edited - 30 Aug 2021
avatar Mat-o Mat-o - change - 30 Aug 2021
Title
Modal links are broken with Joomla 3.10
Modal links are broken in Joomla 3.10
avatar Mat-o Mat-o - edited - 30 Aug 2021
avatar drmenzelit
drmenzelit - comment - 30 Aug 2021

As far as I can see nothing changed in Joomla 3.10, the modal behavior was not removed. Which template are you using? Maybe something changed there or on some override, because you need to load JHTML::_('behavior.modal'); to get your code working.
I tested on a 3.10 installation adding the modal behavior in Protostar and it worked.

Mootools was removed in J4, so the code above will not work anymore.

avatar Mat-o
Mat-o - comment - 30 Aug 2021

Thank you, your answer helped me a lot.
I was using JHtml::_('bootstrap.framework'); instead of JHTML::_('behavior.modal');
Now the modals are back again.
I don't think it shoud be considered a regression, because I was not calling the library correctly in the first place.
Maybe others will have the same problem after updating, so I hope this thread can help them.

avatar alikon alikon - change - 30 Aug 2021
Status New Closed
Closed_Date 0000-00-00 00:00:00 2021-08-30 16:47:05
Closed_By alikon
avatar alikon alikon - close - 30 Aug 2021
avatar alikon
alikon - comment - 30 Aug 2021

ok then let's close it

Add a Comment

Login with GitHub to post a comment