xirdion/contao-modal-bundle

Add a modal (dialog) element to your web page.

Installs: 312

Dependents: 0

Suggesters: 0

Security: 0

Stars: 3

Watchers: 2

Forks: 1

Open Issues: 2

Type:contao-bundle

1.0.4 2022-08-22 06:39 UTC

This package is not auto-updated.

Last update: 2024-04-23 16:11:15 UTC


README

Packagist Version Packagist Downloads

This bundle adds the ability to show a dialog element in your Contao website.

It uses the HTMLDialogElement and its showModal() and close() methods to show and hide the content.

Additional attributes are added in the HTML:

role="dialog"
arialabelledby=""
ariadescribedby=""

The element is available both as a content element and as a module.

elements

Content options

There are three options available for the modal's content.

content_types

Text and Image

Besides a heading, a text (TinyMCE) can also be added.

Additionally, you have the possibility to select an image with image size.

Image

Only one image with image size can be selected for the content.

HTML

Custom HTML content can be inserted for the content.

Opening options

There are three different opening options available.

opening_types

Time

You can select an amount of seconds in the back end.

After the page has been loaded the modal will show up automatically after the selected amount of seconds.

Furthermore, you can select an amount of days for which the user should not see the modal anymore.

Scroll position

If this option is selected, the modal will show up automatically if its section in the content is reached.

Here, too, you have the option to specify the number of days that the user will not be interrupted afterwards.

Button

If this option was selected, an additional button is shown in the front end.

Clicking on the button will trigger the modal.

Settings

There is an option not to display the modal on certain pages.

Furthermore, a link can be stored. If you are on its target page, the modal is also not displayed.