Hi,

I would like to modify link's path on a menu. How to do? Am I supposed to use hook_menu? Do you have an example?

Comments

nevets’s picture

If you want to modify a menu link defined by another module you would implement hook_menu_alter()

kaalmans’s picture

OK. I have to write my code on the hook_menu_alter(). So, I am creating my first module but it's a little bit difficult to find all the functions I need on the documentation.
Here my algo:

If (I am on my destination menu) Then
For each links of my menu
url=current_url+link_name

End If

nevets’s picture

It is not clear what you are trying to do.

Are the menu entries you are trying to modify from your module or elsewhere?

How/why are you trying to modify them?

kaalmans’s picture

I have created a view with 2 arguments.
When I am on my page www.mywebsite/destination/COUNTRY, i have a new menu "category" which allow me to display for example every hotel of a country.
I would like to modify the links of the "category" menu to have something like www.mywebsite/destination/COUNTRY/CATEGORY. The idea was to override the link... Am I wrong?

NB: the "category" menu come from a taxonomy

kaalmans’s picture

Any help?

kaalmans’s picture

Any recommendation?