Last updated October 22, 2010. Created by kbk on October 22, 2010.
Log in to edit this page.

Goal: Dynamically construct a link that forwards a user to their edit content profile page (e.g. www.foo.com/user/1/profile/person).

Problem: Drupal's Core menu system is not token-enabled. The tricky part is that the 1 must be dynamically replaced with the [User:ID] of whomever is logged in.

Note:
This concept can be applied to both internal links and menu items.
This is something of a workaround and there are no doubt other ways to accomplish this.

Assumptions:
Some familiarity with all modules employed here.
A content type call Person which is part of the user profile.
No knowledge of PHP or the Drupal API.

Modules:
Content Profile
CCK
Rules
Token - to get the User ID info
Path Rules - Allows you to "Check Path" of destination URL.

1) Create a Page. Call it pageX

2) Under "URL path settings" set a custom URL for pageX. Call it pageX-url. You can also just remember the Node ID and use that instead of a custom URL.

3) Pick a menu to modify (admin/build/menu) and add a menu item that directs users to pageX (path: pageX-url) when clicked on.

4) Configure a rule (admin/rules/trigger) that redirects users who are about to visit www.foo.com/pageX-url to www.foo.com/user/[user:ID]/profile/person:

- Event: "Content is going to be viewed"
- Condition: "Check Path" where the path to check for is "pageX-url"
- Action: "Page redirect" where To: user/[user:uid]/profile/person

5) Navigate to www.foo.com/pageX-url, you should be forwarded to the edit form of the user profile listed above.

Looking for support? Visit the Drupal.org forums, or join #drupal-support in IRC.