I have an question about drupal's redirect.
Well I implemented hook_menu for the path: "node/%node/boost".
And I set all callbacks from default node path: "node/%node".
/**
* Implements hook_menu().
*/
function my_module_menu() {
$items['node/%node/boost'] = array(
'title callback' => 'node_page_title',
'title arguments' => array(1),
'page callback' => 'node_page_view',
'page arguments' => array(1),
'access callback' => 'node_access',
'access arguments' => array('view', 1),
);
return $items;
}
So I would get the node from my custom URL
but I got the redirect to default node URL like "node/123".
Any idea how can I load nodes from the my custom URL?
Thanks
UPD
If I change "page callback" function to the my custom function "my_module_page_view", for example:
/**
* Callback.
*/
function my_module_page_view($node) {
return 'Hello Drupal!';
}
I will see the text "Hello Drupal!" on the page with URL "/node/1/boost".
But if I use the next code:
/**
* Callback.
*/
function my_module_page_view($node) {
return node_view($node);
}
I will get redirect from "/node/1/boost" to "/node/1"