By Aibu on
Is there a way to override other modules paths from the module I am developing?
For example, in Ubercart, you have the user order page under user/%/orders.
Is there a way to change this path without modifying the ubercart order module?
Basically I would like to leave only profile view and profile edit under the user/ path and put all other user related stuff under dashboard/
I haven't found a way yet to do so. Any help is welcome!
Comments
Path Set Alias
Use the function path_set_alias.
Shyamala
http://www.unimitysolutions.com
Hi Shyamala, thanks for
Hi Shyamala,
thanks for pointing me to the right direction.
This is working fine, but unfortunately, even if the path is different, the page is shown inside the user profile section of the site (and as a tab of the user section).
What I would like to achieve is to completely remove orders from the user section and call it from some other places. For what I have seen, this is not possible, unless I modify the order module (which is something I would like to avoid).
I would be happy if you could tell me I am wrong!
Thanks a lot!
Hook Menu Alter
What you want is not just to change the path but also to reset some of the menucallback's properties. You can do this by using Hook Menu Alter.
i.e you are now changing the type of Menu callback user/... from MENU_LOCAL_TASK to a regular MENU_CALLBACK. This callback will no longer be displayed in a tab.
Shyamala
http://www.unimitysolutions.com
Thanks again, but no
Thanks again,
but no success...
If I use the hook menu_alter, drupal says to me that I have no access to the page:
then I tried with:
but I still receive an access error...
But for sure the information you gave me are correct. I will try to explore and learn a bit more.
Thanks a lot!
Solved, thanks a lot! The
Solved, thanks a lot!
The issue was on declaring the wild card.
Instead of:
I had to use:
changing % to %user as explained here:
http://drupal.org/node/483324
Thank you!
thanks this was helpful. Did
thanks this was helpful.
Did it allow you to print what was at user/%user/orders to your new path with the content appropriately themed?
http://SocialNicheGuru.com
Delivering inSITE(TM), we empower you to deliver the right product and the right message to the right NICHE at the right time across all product, marketing, and sales channels.