To whom it may concern: I just installed joomla 4.0 alpha and installed a custom extension of mine there in which uses mootools (JHTML::_('behavior.modal');), but it simply does not work. is there another library for mootools with a different syntax in this new version of joomla? Kian William
In Joomla 4 we've completely removed the Mootools library and any API functions for it. If you'd like to utilise a modal, you can use
JHtmlBootstrap::renderModal which is currently a wrapper for Bootstraps JS modal component, however we're rewriting the main components as custom elements.
Here is an example for you to build on top of:
// Add this to the top of your PHP file use Joomla\CMS\HTML\HTMLHelper; use Joomla\CMS\Language\Text; // Render Modal echo HTMLHelper::_( 'bootstrap.renderModal', 'versionsModal', array( 'url' => 'URL', 'title' => 'Modal title here', 'height' => '400px', 'width' => '800px', 'modalWidth' => 80, 'bodyHeight' => 60, 'footer' => '<a type="button" class="btn btn-secondary" data-dismiss="modal">' . Text::_('JCANCEL') . '</a>' ) );