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 2


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.

  • Exactly same answer is given by @Nagarjun on May 21. May 26, 2015 at 12:36
  • 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.
    – Nehal
    May 27, 2015 at 6:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.