I am trying to create a menu item that loads a view mode that calls the callback function with the path alias.
$items['node/%/%'] = array(
'page callback' => '_node_view_load',
'page arguments' => array(1, 2),
'access callback' => TRUE,
'type' => MENU_CALLBACK
);
function _node_view_load($node_id, $view_mode = 'default') {
return drupal_render(node_view(node_load($node_id), $view_mode));
}
This works if you go to /node/%/view_mode. However, it does not work if you got to /alias/view_mode. I get page not found. Is there a way to bind menu items to path aliases?
node/%node/%
, and the call tonode_load()
would not be necessary; the last%
is a catch-all, and it could match paths already defined by other modules.