Joomla 2.5.8。如何在模式框弹出窗口中仅显示文章或模块内容。

时间:2013-02-06 16:00:06

标签: joomla modal-dialog joomla2.5 squeezebox

我想将登录模块放入模态弹出窗口。但是当我使用class =“modal”时,整个页面被加载到模态中。你能告诉我如何放置模块。

这也适用于以模态显示文章。

here is the link with problem

3 个答案:

答案 0 :(得分:4)

我经常这样做,并且有两个技巧可以帮助使这项工作更好。首先,您可能希望将tmpl=component添加到您的网址。这导致Joomla只显示文章而不是整个模板(只要你的模板支持这个,大多数都支持这个)。

这应该做得很好。如果你想要更有选择性,你可以做以下两件事之一:

添加CSS以隐藏件

.modal-body .other-selector {
    display:none;
}

使用Javascript仅选择您想要的作品

$('#myModal').on('show', function () {
  // selects a piece of the current modal body and sets it as the only content of the modal
  $('#myModal .modal-body').html($('#myModal .modal-body').find('.other-selector).html());
})

答案 1 :(得分:1)

您只能显示组件的方法是在url中添加一个额外的参数tmpl=component。如果您在模板文件夹中看到主要为<jdoc:include type="component" />而没有模块的component.php position。所以它只加载组件。

我没有尝试使用模块,但你可以尝试类似的模块。所以你可以尝试通过在整个模板中给出模块的位置,比如在模板文件夹中创建一个名为modules.php的新页面并放置模块在此页面中的位置。您可以像tmpl=modules

这样的组件以类似的方式调用它

我希望这会奏效。

答案 2 :(得分:0)

我的模板component.php文件出现问题。我刚刚添加内部,现在它工作正常。谢谢你们