So I tried to create a menu link both in the main and user menus that would take a user to a page named after their user name. I used the token [current-user:name] for the link's path, but left all of the menu token options disabled. I made sure the it was checked as "enabled" and saved it. It saved fine, but on reloading my page, the link does not appear. Is there something I'm missing?
Also, I tried playing around with the menu token options to see what they do, and whenever I chose a "from context" option such as "user from context" and try to save, it tries to delete the link instead. Is this expected?
Sorry in advance if these aren't bugs and I'm just using the module wrong. Thanks!
Comments
Comment #1
havabeer commentedExperienced the same thing when trying to create a main menu link for user/[current-user:name]/mycontent. The link disappears from the menu.
However, user/[current-user:uid]/mycontent does work.
(I'm using Extended Path Aliases module. I tried uninstalling it, but it didn't make a difference.)
Comment #2
tribalrose commentedI'm getting the same behavior trying the same type of menu links you both described and ... nothing. If I throw in http:// at the front the link will show up but the token won't replace in the path and shows up as [user:uid].
Comment #3
scottcarlton commentedSame here too! Replaced it with user/[current-user:uid]/order and worked.
Comment #4
frixos12 commentedsubscibing
Comment #5
epsilon1983 commentedCame up with a workaround. I created a blank page and linked my menu link to that. Then I used Rules to redirect from that page to user's page using the [site:current-user] token. It works how I want it to, so I uninstalled this module since I don't need it.
I'm leaving this issue active though since it still seems to be a problem with this module.
Comment #6
raulmuroc commentedIt is a major issue, from my point of views cuz if this is not solved, the module doesn't work at all hence the menu link is not seen so it is like if it doesn't exist.
Comment #7
dealancer commentedHey guys,
Thanks for the feedback.
As path user/[current-user:name]/mycontent is not working in the Drupal this link could not be showed. Try to enter in browser user/admin and user/1 and see what will happen. First link won't work, so there is no reason to show it.
Menu token checks access to the link, if user have no access or if link is not exitst is is hidden. So there is no issue at all. Closing it.
Comment #8
infines commentedThis needs to work for all of us using the PathAuto module generating the [current-user:name] for user profiles.
Comment #9
dealancer commentedNow paths such as users/[current-user:name]. I hope that user/[current-user:name]/mycontent are too.
Comment #10
develcuy commentedI did the following test based on comment #1:
- Created alias 'users/admin' for 'user/1'
- Created a menu item with path: 'user/[current-user:uid]'
- Created a view to list the content of such user, at path 'user/%user/mycontent'
- Enabled module 'Extended path aliases'
- Went to url: users/admin/mycontent
And works!
- Then changed the menu item to the path: 'users/[current-user:name]'
- Again, went to url: users/admin/mycontent
And works!!!
Awesome use case, thanks for the idea!