duansai1314 2011-04-13 00:03
浏览 40
已采纳

在模式框内禁用Joomla模板

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 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:

  1. Write a url that will output only the module's contents, and disable the Joomla template.
  2. Currently, a modal box uses an iframe to include another page inside of it. Is there any way to replace the iframe with content?
  3. 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?
  4. If all else fails, I can use die(); to skip writing the template.

I am using Joomla 1.5

  • 写回答

1条回答 默认 最新

  • dsgrs26202 2011-04-13 13:19
    关注

    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.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥23 (标签-bug|关键词-密码错误加密)
  • ¥66 比特币地址如何生成taproot地址
  • ¥20 数学建模数学建模需要
  • ¥15 关于#lua#的问题,请各位专家解答!
  • ¥15 什么设备可以研究OFDM的60GHz毫米波信道模型
  • ¥15 不知道是该怎么引用多个函数片段
  • ¥30 关于用python写支付宝扫码付异步通知收不到的问题
  • ¥15 隐藏系统界面pdf的打印、下载按钮
  • ¥15 基于pso参数优化的LightGBM分类模型
  • ¥15 安装Paddleocr时报错无法解决