I need to make a primary link menu item to go to the IMCE file browser. The url is:

/user/%user_id/imce

where %user_id is the numeric user id. How can I make a menu item so the actual user id is substituted?

Comments

3CWebDev’s picture

I don't know the answer but I had the same question/problem a few days ago. With my scenario I was able to point my regular primary link to a Views 2 path and then used a views argument to insert the user ID.

I'm curious to see if someone has an answer for your question though :)

The Cosmic Gift | Complete Computer Care | Team Hope

Dody’s picture

just % and it will be. :)
blog/%
user/%/edit

mulogic’s picture

For the menu path "/user/%user_id/imce", Define a function with the name user_id_to_arg(). Return the value you want to replace the wild card with. (in your case the user id)
__________________________________________
Jaanlo - The how to site

mattyoung’s picture

>Define a function with the name user_id_to_arg()

Where do I define this function and how to use it?

I am talking about define a menu item in the primary link. What is the text I should put in the Path field?

mulogic’s picture

Hi,

Since the path of the menu is dynamic (i mean it varies from user to user), i guess it may not be possible to do it from GUI. You can write a custom module to implement this menu link.

Take a look at user_uid_optional_to_arg . i guess this is how user module implements the my account link. you need to have something like this or may be use the same function defined by user module. but in any case, i guess you need to write a small snippet.
__________________________________________
Jaanlo - The how to site

WorldFallz’s picture

i use the http://drupal.org/project/me module for exactly this-- though it hasn't been ported to d6 yet, it seems as if someone might post a patch shortly.

===
"Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." - Lao Tzu
"God helps those who help themselves." - Ben Franklin
"Search is your best friend." - Worldfallz

kejsu’s picture

thanks, it helped :))

offerman’s picture

To create a link to the user's IMCE page, I used the Menu token module. It gives a nice overview of the available tokens in the menu editor.
The menu link I'm now using: user/[current-user:uid]/imce