Does Joomla 3.4 has any standard API for showing a lightbox container. The idea is to show a view inside a lightbox container on a button click.
2 Answers
Yes, you can use the API code like below
JHtml::_('behavior.modal', 'some_id_of_model');
Now your link to open the model
<a class="btn btn-primary some_id_of_model" title="title" href="url of the content" rel="{handler: 'iframe', size: {x: 800, y: 500}}">Open Model</a>
Add <?php JHtml::_('behavior.modal'); ?>
to your template's index file and call the modal box (lightbox) using this code
<a href="https://www.google.com" rel="{size: {x: 700, y: 500}, handler:'iframe'}" class="modal"> Open Lightbox </a>
If you do not see anything then check once, as if you used bootstrap template or css then by default modal
class is given as display:none
. So remove that display none property and then check for ti.
-
-
Not at all, he hasn't used **
class="modal"
** , which is faar more important for modal box. @SahilPurav you better watch answers very clearly, then try to take any action.– NehalMay 27, 2015 at 6:38