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.

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

报告相同问题?

悬赏问题

  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么
  • ¥15 banner广告展示设置多少时间不怎么会消耗用户价值
  • ¥16 mybatis的代理对象无法通过@Autowired装填
  • ¥15 可见光定位matlab仿真
  • ¥15 arduino 四自由度机械臂
  • ¥15 wordpress 产品图片 GIF 没法显示
  • ¥15 求三国群英传pl国战时间的修改方法
  • ¥15 matlab代码代写,需写出详细代码,代价私
  • ¥15 ROS系统搭建请教(跨境电商用途)
  • ¥15 AIC3204的示例代码有吗,想用AIC3204测量血氧,找不到相关的代码。