I have made a custom module in Drupal 6 and want to implement the following: When I click on my link it should open in a pop up window in javascript. But I don't know it how to implement pop up window in Drupal.

Please help me.

This is my link code.

l('open pop up','admin/state_user/stateadmin/state/user/disable/'
  . $result -> uid, array('attributes' => array('title' => t('open pop up'))),TRUE);
  • You can achieve popup using CTools API. Check examples of CTools contributed modules. You will find a code to open modal popup by clicking on link. – mohit_rocks Jun 4 '13 at 5:12
  • I just wnat to use pop up window in java script only.... – user2114575 Jun 4 '13 at 5:15

Use the Colorbox module.

Colorbox is a light-weight customizable lightbox plugin for jQuery. This module allows for integration of Colorbox into Drupal.

Images, iframed or inline content etc. can be displayed in a overlay above the current page.

You need to activate the iframe method and add the custom iframe class to your link.


Though window.open is not considered as good practice but still if you want to open window in D6 using this then you can do like this.

Create a link

<?php echo l('product', 'product', array('attributes' => array('id' => 'product-link'))); ?>

Add JavaScript file & add it to theme.info or call it in some custom module.

Write javascript code as

function() {
    function(e) {

Not the answer you're looking for? Browse other questions tagged or ask your own question.