5

I have developed a custom component that displays some information. I want to show the same information in modal popup window without header and footer information. what should be best approach to achieve this?

2 Answers 2

8

Haven't done this for awhile, but these steps should do it:

  1. Add JHTML::_('behavior.modal'); near the top of the view
  2. Add class="modal" to any links you want to open in a modal window
  3. Add &tmpl=component the the link you want in a popup

Note: I answered, then deleted this because upon trying it with a J3.3 installation, I got some javascript errors, so I can't say for sure that it remains the right way of doing it or is an issue with our template.

1
  • Just a note that 'behavior.modal' will utilise Mootools rather than Bootstrap
    – Lodder
    Apr 6, 2018 at 15:34
2

I have used the Modal plugin from Regular Labs to do something like you describe. There is a free version and a Pro version available. Their plugin is easy to use and with minimum reading of their tutorial, anyone can use them.

I am not affiliated with them, nor do I have any kind of relation with them.

Link: Modal

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.