0
votes

By default on a page I have the following menu:

Profile /profile
Albums /album
Awards /awards

Going to any of those pages will load the page default.

If I go to a page on my site such as /mycontent/1 I wish to change a the menu to be the following.

Profile /profile/1
Albums /album/1
Awards /awards/1

I want to pass the argument (nid) to the menu. Is this possible?

Update The selected answer does do what I asked. I however have changed how I am doing things to use Panels to display the content. I am then using some CSS and JavaScript to hide and show content. With views caching it seems to be working well.

2

2 Answers

0
votes

Yes,use arg(0),arg(1), or arg(2) depending on which variable you want to use. It will use the path like the indexes of an array (0/1/2/3/4/etc...). Drupal will send you these variables as they were before the path was aliased if that is something that has been applied to it. Why are you passing the variable? There is probably a better way to do it the "Drupal" way..

0
votes

Actually I am working on this same problem currently where I need to translate an aliased path: dept/profile/1 to load node/1223/profile/1 where 1 is the ID of the profile to show.

What I am using now is the URL Alter module and implementing the hook it gives to enable this feature. If you are interested in this maybe we can see if it is possible to get module out with a GUI.

My thread on this that is active now: Using module: url_alter and it's hook: hook_url_outbound_alter()

I am using a node that houses a panel which has a view inside it, for reasons that are site specific.