Video: Using the POPUPS API in Drupal6Video: Using the POPUPS API in Drupal6
Have you ever wanted to add the dazzle of POPUPS to your site? Maybe you have used lightbox for the POPUP effect on images, but how do you simply add popups to other elements or pages or forms?
One of our faithful Drupal Video Blog watchers asked for an explanation of the POPUPS API module which can be downloaded at http://drupal.org/project/popups and does a very good job of explaining itself. But this video will get you through it even quicker!
Here's what I did:
- Install the POPUPS API module into your sites/all/modules directory
- I strongly suggest that you also visit the README file within the module folder ot see all the tips and tricks that they explain! :-)
- Enable the module
- Goto the settings pageSite-Configuration -> POPUPS
- Tick the box next to "Scan all pages for popups" [I do note that this may not be the best idea if your site gets a lot of traffic as this "scan" will draw upon some resources thta you may or maynot want running on every page request
- In my example I went into the hard-coded CONTACT ME link in my page.tpl.php and I added the POPUPS class to the anchor. [ex. <a href="/content/contact/doug-vann" class = "popups">Pop This Link</a>]
- After refreshing the page, we noticed that the link for CONTACT ME suddenly had a very small, little box near the upper right of the link-text.
- I clicked the link in the header at DougVann.com and, sure enough, the form popped up! [Want to say HELLO & test it out? Click my link (opens a new page) and see the popup in action!]
I have tested this method and submitting the form DOES result in a properly validated form submission. Look into the README file for various other classes you can apply to links to fine-tune the way the POPUP will interact with form submissions.
- Doug Vann