This module gives Drupal the ability to easily change links into popup dialog boxes.
LIMITATIONS: Does not work with tinymce. Unlikely to work with other WYSIWYG's.
There are a couple of ways to use this module.
#1) Attach popup behavior to a link with popups_add_popups call.
// In your code
popups_add_popups(array('#mylink', '#mylink2=>array('width'=>'200px')));
array('width'=>'200px'))); ?>
This is the simplest method, especially if you want to pass in per-link options.
#2) Add the popup class to an existing link (you still must make sure popups_add_popups() is called
sometime for the page).
Example in code:
popups_add_popups();
$output .= l("Pop up entire local page.", 'popups/test/response', array('attributes' => array('class' => 'popups'))) ."
";
Example on the theme level:
element(s).
'table td:nth-child(2) a' => array(
'noReload' => true, // Popup will not modify original page.
),
)
Options:
noReload: Does the popup leave the original page unmodified (Default: false).
forceReturn: url to force a stop to work flow (only use in conjunction with noReload).
href: override the href in the a element, or attach an href to a non-link element.
width: override the width specified in the css.
targetSelector: hash of jQuery selectors, which override what content should be swapped in from the new page.
updateTitle: update the title of the current page with title of the new page (NOT WORKING).
[These last two can be called from the hook or popups_add_popups, but not with the on-popups-options attribute]
additionalJavascript: Array of JavaScript files that must be included to correctly run the page in the popup.
additionalCss: Array of CSS files that must be included to correctly style the page in the popup.