Joomla 1.7 popup extension to load module inside

2019-08-07 02:22发布

问题:

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.