I made a menu in administration, constructions, menu. I need to change the title, because it seems on the menu, of one of many hyperlinks primarily based on the gender of the at the moment logged in person.
I’ve discovered a number of solutions to comparable questions however I am unable to work out find out how to implement the options. A few of them counsel utilizing hook_menu_alter(&$objects) and a separate callback operate, however I do not perceive the construction of $objects. I hoped to simply print out the worth of $objects, discover the string I needed to vary, and alter that worth in $objects within the hook. Apparently, although, you may’t debug the $objects variable as a result of hook_menu_alter is never referred to as. I attempted to determine the construction of $objects from a bunch of different questions and solutions and I discovered stuff like this:
$objects['user/%user_category/edit']['title']
Why is ‘title’ a property of a path? Does this imply that each menu in your website that has a hyperlink to that path will show the title that you simply set the above variable to? What in the event you needed a hyperlink to a particular path on one menu to have a distinct label than a hyperlink to that path on one other menu? Is not there someplace I can entry and alter the title of a menu hyperlink like this
$allMenuData['My Custom Menu']['an item on my menu']['title']