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
Haven't done this for awhile, but these steps should do it:
- Add
JHTML::_('behavior.modal');
near the top of the view - Add
class="modal"
to any links you want to open in a modal window - 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.
-
Just a note that
'behavior.modal'
will utilise Mootools rather than Bootstrap– LodderApr 6, 2018 at 15:34
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