Joomla 1.7 popup extension to load module inside

旧城冷巷雨未停 提交于 2019-12-11 05:14:10

问题


Please let me know, if there any extensions available to display module inside the popup, and popup should load after user login.

Scernario :

  • I have opinion poll module, which should popup once after user login into the website.
  • I need to specify the module from the backend, either by id or module position.
  • The user will vote for the poll after login into the website and close the popup after voting.
  • It will be great if it is Non-commercial extensions.

Please suggest me on this.


回答1:


Try this,

You can load any module inside popup or any other page(in ajax page too).By using the following codes

 $document = &JFactory::getDocument();
 $renderer = $document->loadRenderer('module');

 $Module = &JModuleHelper::getModule('mod_fmDataGrid');

 $Params = "param1=bruno\n\rparam2=chris";//This will only required when you pass module params through code
 $Module->params = $Params;
 echo $renderer->render($Module);

You can create the popup ,The section generating popup content try the above code too.

Hope this may help you..




回答2:


The best way to do this is to create an override for your module (see http://docs.joomla.org/Layout_Overrides_in_Joomla_2.5) and wrap it inside a modal, then set it to registered only. If your site uses Twitter Bootstrap (which most commercial Joomla templates do these days) you can use the markup here: http://twitter.github.com/bootstrap/javascript.html#modals

You'll need some basic knowledge of HTML & PHP to achieve this though.



来源:https://stackoverflow.com/questions/15068065/joomla-1-7-popup-extension-to-load-module-inside

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!