1

I have several modules that make extensive use of the Ctools Automodal modal to activate custom-driven modals. These Link references live in their own module, example_item_modals:

/**
 * Implements hook_menu()
 */
function example_item_modals_menu() {
  $items['product/product1'] = array(
    'page callback' => 'product_order_modal_1',
    "access arguments" => array('interact with orders'),
    'type' => MENU_LOCAL_TASK,
    'modal' => TRUE
  );

  $items['product/product2'] = array(
    'page callback' => 'product_order_modal_2',
    "access arguments" => array('interact with orders'),
    'type' => MENU_LOCAL_TASK,
    'modal' => TRUE
  );

  return $items;
}

We have another module that loads in a User Profile (developed by another third party) and the requirements call for loading some of the products here, and interacting with the modal. Actually displaying the links are done using a tpl.php call to those menu calls with an l().

<ul>
  <li>
    <?php echo l("View Product", "product/product1"); ?>
  </li>
</ul>

So when we eventually load the template call in this custom user profile module, this link should load and have the necessary logic to fire the modals. Except, its not. Here, it treats it like a backpage link. Is there something I am missing for this link to function as a modal? Do I need to explicitly include the parent module the links are defined with, and if so, what API call accomplishes that? (I looked at module_load_include() but i'm importing settings thrown in the .module, not a .inc file).

2 Answers 2

1

I think you need specific class for your link to be preprocessed as a modal link (but i don't know the 'automodal' feature so maybe im wrong)

0
-1
<ul>
  <li>
    <?php echo l("View Product", "product/product1", array('attributes' => array('class' => array('ctools-use-modal')))); ?>
  </li>
</ul>
1
  • To make this a more useful answer, try adding some text indicating what this does and why this fixes their problem Oct 5, 2015 at 15:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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