Greetings fellow Druplers!

I am developing a bespoke node module, called "players".

I am tying to add onto the menu of my module two MENU_LOCAL_TASKS history and statistics see below.

  $items['node/%node/history'] = array(
    'title' 				=> 'History',
    'page callback' 		=> 'player_history',
    'page arguments' 		=> array(1),
    'access arguments' 	=> array('access content'),
    'weight'                        => 2,
    'type'                          => MENU_LOCAL_TASK,
  );
  $items['node/%node/statistics'] = array(
    'title' 				=> 'Statistics',
    'page callback' 		=> 'player_statistics',
    'page arguments' 		=> array(1),
    'access arguments' 	=> array('access content'),
    'weight'                         => 3,
    'type'                            => MENU_LOCAL_TASK,
  );

Now this is where the pain begins, as this is technically a node my path must begin with node/ for it to display.

I want the path to display as player/%/history, does anyone know how this can be done.

Thanks in advance!

Comments

exaboy’s picture

Ive just done some further digging in the poll module and they have the same issue.

When you view the poll it displays the url alias as poll/the-name-of-your-poll however when you view the tab to see the Votes its showing node/34/votes.

If a core module doesn't use the alias for the tabs how can we go about getting that into the core as it seems to have been overlooked.

This has been a nice discovery :)

kovalev’s picture

Once any of these nodes are created, you can intervene with hook_nodeapi and create a path alias: "node/%node/history" to be aliased to "player/%node/history" with path_set_alias
------------------------------------------------------------------------------------------------------------------------------------
Sergata - פיתוח תוכנה

exaboy’s picture

This is what i had to implement thanks for the reply Sergata, i have raised this with the path project team as it makes sense that it should be a wildcard thing.