I am trying to create a menu using code in D7 (see my related question) and have found that these two Drupal API functions have different arrays for the $item variable. My intent is to create a three level menu hierarchy but with all of the associated paths being the same format /name/%/something
so that I can use views to refine the content. In hook menu, the parents are defined using the Path name (eg. parent/child/something
). In menu_save_link, the hierarchy appears to be established using the pid
array value in $item. Hook_menu is called when my custom module is read by drupal and the menu links are established. What I am wondering is if menu_link_save
, could be used to do the same thing but with the same path style for all links, rather than a parent-child pattern?
I have been trying to trace the logic between the two functions in the API, but have not found the link between them. My thinking is that menu_link_save
is used by hook_menu
after some preprocessing and that I might be able to define a uniform paths and establish the hierarchy through the pid
. Failing that, is there another way to alter the paths and preserve the hierarchy?