Modals

Make modal popups in Joomla!

  • Last updated: 12 Aug 2019
  • Version: 11.5.2
  • Type: System plugin
  • Joomla rating: 100%

Examples for Modals

Simple Modals

Width & Height

Galleries & Slideshows Pro only

Inline content Pro only

Grouped mixed content Pro only

To make a menu item open in a modal popup, simply surround the menu title in {modal} tags.

So if your menu item title is Click here!, change it to {modal}Click here!{/modal}.

You can also pass extra variables in the tag as described earlier, like: {modal title=My Page}Click here!{/modal} or {modal width="600" height="400"}Click here!{/modal}.

If for some reason you don't want to use the {modal} tags (or it doesn't work), you can also give the menu item a custom classname (works with most menu modules) and set Modals up to convert by that classname.

Auto-close Pro only

You can make a modal window auto-close after a given amount of time using the autoclose attribute.

To make the modal close after the default amount of time set in the Modals plugin settings, simply add the autoclose=1 attribute:

Example

{modal url="my/url" autoclose="true"}...{/modal}

But you can also set a different time in milliseconds. So if you want to auto-close the modal after only 2 seconds, do:

Example

{modal url="my/url" autoclose="2000"}...{/modal}

Splash pages: Open modal on pageload Pro only

To make modal popup on pageload, simply add the open="true" to the {modal} tag, like:

{modal url="my/url" open="true"}...{/modal}

If you do not want to show the actual link to the page, then simply don't place any text between the {modal} tags, like:

{modal url="my/url" open="true"}{/modal}

The syntax for modal url popup you saw on page load of this page, looks like:

{modal html="Yes, you can also make modal popups show on page load!" title="Welcome to the Modals Examples Page" open="true" autoclose="5000"}{/modal}

Show only once

To make a modal popup only show once, you can use open=once, like:

{modal html="This modal will only show once" open="once"}{/modal}

By default, Modals will keep track of the count via a site wide cookie. If you want this count to be based on the individual page visits, then you can change that in the Modals system plugin settings. You can also choose to base the count on the site wide session count instead.

Show on specific page loads

You can also tell Modals to show the modal on a specified range of visits, using the open attributes. For instance, to show a modal on the second, third and fourth page load, you can do:

{modal html="This modal will only show once" open="2-4"}{/modal}

This way you can have one modal for first page load, and another for the second.

By default, Modals will keep track of the count via a site wide cookie. If you want this count to be based on the individual page visits, then you can change that in the Modals system plugin settings. You can also choose to base the count on the site wide session count instead.