--- token_node.inc.orig 2008-07-31 17:15:13.000000000 +0000 +++ token_node.inc 2008-07-31 17:44:31.000000000 +0000 @@ -57,6 +57,18 @@ function node_token_values($type, $objec $original_mid = token_menu_get_mid('node/'.$node->nid); $mid = $original_mid; + + //ADDED BY XJM + $values['parent_path_alias'] = ''; + if ($_menu['visible'][$mid]) { + $values['parent_path_alias'] = $_menu['visible'][$_menu['visible'][$mid]['pid']]['path']; + if ($alias = drupal_get_path_alias($values['parent_path_alias'])) { + $values['parent_path_alias'] = $alias; + } + } + $values['menu_title'] = $_menu['visible'][$mid]['title']; + // END ADDITION + while ($mid && $_menu['visible'][$mid] && $_menu['visible'][$mid]['pid'] != 0) { array_unshift($trail, check_plain($_menu['visible'][$mid]['title'])); $mid = $_menu['visible'][$mid]['pid']; @@ -192,6 +204,12 @@ function node_token_list($type = 'all') $tokens['node']['menu-raw'] = t("The name of the menu the node belongs to. WARNING - raw user input."); $tokens['node']['menupath'] = t("The menu path (as reflected in the breadcrumb), not including Home or [menu]. Separated by /."); $tokens['node']['menupath-raw'] = t("The unfiltered menu path (as reflected in the breadcrumb), not including Home or [menu]. Separated by /. WARNING - raw user input."); + + // ADDED BY XJM + $tokens['node']['parent_path_alias'] = t("The actual path of the parent menu item, using a path alias if one is available."); + $tokens['node']['menu_title'] = t("The title of the node in the menu."); + // END ADDITION + return $tokens; } }