Download the PHP package heimrichhannot/contao-modal without Composer
On this page you can find all versions of the php package heimrichhannot/contao-modal. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download heimrichhannot/contao-modal
More information about heimrichhannot/contao-modal
Files in heimrichhannot/contao-modal
Package contao-modal
Short Description A solid contao modal layer framework.
License LGPL-3.0+
Homepage https://github.com/heimrichhannot/contao-modal
Informations about the package contao-modal
Modal - A solid contao modal window framework
Modal provides modal elements within modal archives. It works best together with 'heimrichhannot/contao-teaser' and its teaser content elements.
Features
- Url alias support with backlinks (browser history)
- extendable for other modal frameworks/libraries
- custom header/footer
- content elements within modal body
- inserttags
- works together with
contao-disclaimer
- Bootstrap 3 and 4 support
- Contao Components support
Setup
Install: composer require heimrichhannot/contao-modal
We recommend to disable the not used modal framework component in page layout.
Insertags
Insert-Tag | Description | Arguments |
---|---|---|
{{modal_url::*::*::*}} |
Returns the modal url (usage: <a href="{{modal_url::1::home}}">Hier klicken</a> ) |
1: modal id/alias, 2: jump to page id/alias, 3: auto_item id or alias |
{{modal_link::*::*::*::*}} |
Returns the modal link | 1: modal id/alias, 2: jump to page id/alias, 3: link text & title, 4: auto_item id or alias |
{{modal_link_open::*::*::*}} |
Returns the modal link's opening tag (<a href="{{modal_url::1::home}}"> ). |
1: modal id/alias, 2: jump to page id/alias, 3: auto_item id or alias |
{{modal_link_close::*}} |
Returns the modal link's closing tag (</a> ) -> Requires associated {{modal_link_open}} tag. |
1: modal id/alias |
Hooks
Name | Arguments | Expected return value | Description |
---|---|---|---|
generateModalUrl | $arrRow, $strParams, $strUrl | $strUrl | Modify the modal url. |
generateModal | $objTemplate, $objModel, $objConfig, $objModal | void | Modify the modal output. |
getModalContentElement | $strContent, $objElement, $objTemplate, $objModel, $objConfig, $objModal | $strContent | Modify the modal within content element. |
Register custom modules to make usage of modal
If you want to register you list modules for example to make usage of the modal framework, you should enable by adding your module to the $GLOBALS['MODAL_MODULES']
Than you have to implement the links within you list module. The following example is taken from the newslist implementation within the modal framework:
As you can see, we attach to the parseArticles HOOK and adjust all links with ModalController::generateModalUrl()
or ModalController::convertLinkToModalLink()
functions.
To access the Reader entities it is necessary to link the redirect page with a modal. Add a new modal first, attach the reader modules as content element and select "link Modal" within the redirect page in the site structure and assign the previously created modal to the page.
Add custom modal framework
To extend modal with your own framework, you have add the following:
Add your own modal config
You have to register your custom modal within '$GLOBALS['TL_MODALS']'.
Add your modal template
The modal template contains the complete markup of your modal framework. Add as much as possible.
Add your modal link template
The modal link template is required by inserttags (e.g {{modal_link::*}} to provide the correct trigger markup.
Add your modal javascript logic
The modal windows are delivered asynchronous by the ModalController. You have to implement the toggle, close and ajax loading by your own.
All versions of contao-modal with dependencies
contao/core-bundle Version ^3.5.1 || ~4.1
contao-community-alliance/composer-plugin Version ~2.4 || ~3.0
heimrichhannot/contao-teaser Version ~1.0
heimrichhannot/contao-ajax Version ^1.0.13
heimrichhannot/contao-haste_plus Version ~1.0
heimrichhannot/contao-be_explanation Version ~1.0