Disable Joomla template inside of modal box
I am developing a simple Joomla module for the backend, and I am trying to keep it simple. I need to create some kind of popup box, either with a javascript popup window or a modal box. I want some basic 开发者_Python百科content inside of the popup, with Joomla's user validation, but without the Joomla template being displayed. With a component, I could write a url like this:
http://my-site.com/index.php?option=com_component&tmpl=component
This url would only show the component's content, while still making sure the user is logged in. I am wondering if there is any way to do this for a module. Here are some options:
- Write a url that will output only the module's contents, and disable the Joomla template.
- Currently, a modal box uses an iframe to include another page inside of it. Is there any way to replace the iframe with content?
- Create a file on the server that is requested directly, and add a user validation check at the top. Is there any single Joomla file that I could include that would make sure that the user is logged in?
- If all else fails, I can use
die();
to skip writing the template.
I am using Joomla 1.5
First, Joomla has a built in modal box that will display content either in an iFrame or a div. The only required element is adding the class "modal" to the link. You can also pass several parameters to control the lightbox, you can find documentation on those here -
http://digitarald.de/project/squeezebox/1-1/showcase/get-elements/
Next, by default, you cannot display just the content of a module position. The tmpl=component parameter tells joomla to only load the component area of the site, ignoring all of the module positions, so your module would not show up on the page. You would either need to load the module in to an article using {loadposition} or find some other way to put the content in to the component area of the site.
It would be helpful to have links to the actual site and the content you want in a lightbox, this is usually a pretty simple procedure, we do it all the time for all sorts of content.
精彩评论