By mattyoung on
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?
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
Don't know
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
User id in the link
just % and it will be. :)
blog/%
user/%/edit
use to_arg() Functions
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
What should I put in the Path field?
>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?
Implement using a custom module
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
i use the
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
thanks, it helped :))
thanks, it helped :))
Tokens (like [uid]) in menu links are impossible with D6?
http://groups.drupal.org/node/15985
Use Menu token module
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