Once again, I am stuck asking questions on CTools that people have asked a million times before. I have a view that displays a list of custom-developed entities (built with ECK) and each one has a link that should show a Ctools-driven modal.
I looked at a few approaches (namely this) to explore any method to get Drupal to display said modal. I figured that I didn't need all this extra views hook logic to fire the modal -- ideally, if a hook_menu()
click is fired, it should open the modal and any contents I send to it (which will be done through additional methods). Right now, it treats the logic as a static route, and returns the results as a page. I also explored using the Ctools Auto Modal module (seen in the example, which reflects current code), which also returns the same results when used as documented.
I'm completely lost here, mostly because of the reach of Ctools and the various conflicting forms of documentation on its use for something simple as a tie in for hook_menu()
. The long hours i've been pouring into this project are clearly having a toll on my ability to implement this, does anyone have any insight?
The actual logic is below:
/**
* Implements hook_menu()
*
* The sole item call in hook_menu is driven from a URL that is built
* Within a view, from rewrite rules. When activated, it should render
* the new modal window.
*/
function example_menu() {
$items['selectbook/%'] = array(
'title' => "Perk Modal",
'page arguments' => array(1),
'page callback' => 'example_modal_page',
'access arguments' => array('view content'),
'access callback' => TRUE,
'modal' => TRUE,
);
return $items;
}
/**
* Returns a test modal
*/
function example_modal_page($js = null, $attribute = null) {
return "Test Modal"; //Right now returns as new page call not as a modal
}