How to call ctools modal window from mycustom.tpl.php? I need to show a modal window on click from my mycustom.tpl.php 

Here is my code in mycustom.tpl.php

&lt;a href="/modal/nojs" class="ctools-use-modal ctools-use-modal-processed"&gt;False Positiv1e&lt;/a&gt;


In my module file :

$items['modal/%ctools_js'] = array(
    'page callback' =&gt; 'modal_callback',
    'page arguments' =&gt; array(1),
    'access callback' =&gt; TRUE,
    'type' =&gt; MENU_CALLBACK,
  );

 return $items;
}

function modal_callback($ajax) {
    ctools_include('ajax');
    ctools_include('modal');
    ctools_modal_add_js();

    $form_state = array(
      'ajax' =&gt; TRUE,
      'title' =&gt; t('MyModule Modal Form'),
    );

    // Use ctools to generate ajax instructions for the browser to create
    // a form in a modal popup.
    $output = ctools_modal_form_wrapper('modal_form', $form_state);
    // If the form has been submitted, there may be additional instructions
    // such as dismissing the modal popup.
    if (!empty($form_state['ajax_commands'])) {
      $output = $form_state['ajax_commands'];
    }

    // Return the ajax instructions to the browser via ajax_render().
    print ajax_render($output);
    drupal_exit();

}
function modal_form($form, $form_state) {
  $form = array();

  $form['new_link_text'] = array(
    '#type' =&gt; 'textfield',
    '#title' =&gt; t('Link text'),
  );

  $form['submit'] = array(
    '#type' =&gt; 'submit',
    '#value' =&gt; t('Submit'),
  );

  return $form;
}


But when I am clicking on the button, Modal window Breaks and print $output array as below
You have to include below code in your mycustom.tpl.php also.

ctools_include('ajax');
ctools_include('modal');
ctools_modal_add_js();