I've aliased some URLs using the token replacements in the Pathauto module. But I haven't been able to add a link to my Navigation Menu with Token replacements as part of a URL ([user-id], [uid], or [user-name]). I'm using Administer --> Site Building --> Menus and there doesn't seem to be a way to add automatic input from the Token module into the Path field. I can't create a link to 'user/[uid]/track' for example.

I saw that this may not be an issue for the Token module itself (http://drupal.org/node/172065). Is there a better place to post this request?

I just want to have a "my recent posts" link always visible in a menu (or even just in a URL in a block) on every page to authenticated users. There must be some code to change somewhere, to make a [uid] replacement like the built-in 'my account' link. Any ideas? I'm using Drupal 6.1 and Token's stable 6.x-1.10 release.

Thanks.

Comments

goldschmidt.a’s picture

Status: Active » Closed (fixed)

Okay, figured it out - - apparently, when you create a custom link using the Custom Link module, you can add Token substitutions (like [user-id], etc.) as long as you also have the Token module. Then, when you create your custom link, you can choose to have it display "In a sidebar block". Be sure to go to Site Building --> Blocks to enable the block. It is by default disabled! It is called "Custom node links". You can then put this block of links in the header, content, left sidebar, right sidebar, or footer areas! There's the solution for creating a link to "my recent posts," "my blog," "my profile," etc. on EVERY page that has any kind of a post (pretty much any page except the admin panels).

*sigh* So, you can't add custom Token replacements to a Menu or even to a Nice Menu, but you can through using Custom Link module!

Sincerely,
Andrew G

deshilachado’s picture

Thanks for that hint, from the Custom Links module description I wouldn't have tried to use it!

fourmi4x’s picture

I also looked for that for a while, and really think that it would be awesome to be able to use tokens in blocks.

I tried the Custom Link solution, it works, but it is not very flexible... (no possibility, for instance, to set a condition to display the link or not... ?)

But I found a code here : http://drupal.org/node/38150 which say how to use $user->uid instead of the [uid] token, and it works well.

Looking forward tokens in blocks !

unc0nnected’s picture