I have a standard drupal menu using local tasks (menu tabs) and want to have a popups modal form appear when the user clicks the local task button.
Currently the button (tab, link, whatever) yields a simple drupal form which overlays the existing page. But I love the modal popup forms. They take up less space and you can see the form in the context of the page that sourced it and I understand that you can drag them around so you can get even better access to the source page. But I can't see how to incorporate the link from the hook_menu to the popup api.

My question is how do I get to a popup form from the standard hook_menu?

Comments

Tokoh’s picture

I posted this seven weeks ago and have had no response. I'm amazed noone else has an interest in this topic but it was around the silly season so maybe everyone was into Chistmas pud.
I have a simple requirement. I have a standard menu tab (local task) and it pulls up a simple Drupal form constructed using the FAPI. Only instead of the usual page form I want to use a popup form with the Popup API.
The call looks like this:

function wma_order_menu() {
$menu['order/add'] = array(
'title' => 'Add Order',
'page callback' => 'drupal_get_form',
'page arguments' => array('wma_order_add_form'),
'access callback' => TRUE,
'type' => MENU_LOCAL_TASK,
'weight' => 350,
);
.........

How do I change this menu to invoke the form (wma_order_add_form) as a popup?

r3z0nate’s picture

Are you still looking for help on this?

You need to create a link to your form with a class that includes popups.

sidrasultana’s picture

How can i call a drupal pop up on any link?

sidrasultana’s picture

Title: Access to popups from hook_menu » [SOLVED]Access to popups from hook_menu
Status: Active » Closed (fixed)

get it working by using 'attributes' => array('rel' => 'gb_page_center[400,350]'),