Module Description
Menu Token module provides tokens, that could be used in title or in path of menu items (links). For example, if you create a menu item with path: "user/[current-user:uid]", the url will be changed "on fly" to: "user/1" (assuming you are user 1).

Tokens are provided by Token module. Menu Token allows to use both global tokens and entity ones: node, user, term, etc. Entity tokens have several methods of substitution: from context, random and user defined.

NOTE: Menu Token maintainers fully subscribe to the purpose of Contribute module. Let's get it into Drupal core! Join the discussion: #2944651: Encourage participation, acknowledge contributions, and improve sustainability within Drupal (the software)

Menu Token Resources
Menu Token functionality can be extended gracefully. Following some examples:


* Menu Token module implements Ctools plugin system and allows to plug in new token handlers.
* Use Menu HTML module and select "Allow html" in your menu item.
* Superfish integrates jQuery Superfish plugin with your Drupal menus. Use Superfish 1.9-beta5 or greater.
* Use Extended path aliases to automatically translate paths like 'user/1/mycontent' to 'users/admin/mycontent'. Just need to create a 'root' path alias: 'users/admin'. See #1320842: Work with the Path Auto module.
* Menu item visibility exposes configurable and extendable visibility settings for menu links. You'll need to set module weights so that Devel node access > Menu item visibility > Menu Token.
* You can use Tokenize Request Parameters module along with the Menu Token to configure this sort of functionality without the need to code a new module. Tokenize Request Parameter allows you to define what URL parameters to convert into tokens. It makes the tokens available to any token module that consumes tokens (Token Filter, Menu Token, Rules, etc.)

If you know other use cases, please file an issue.

Installation

* Manually: follow the manual
* Via drush: $ drush dl menu_token && drush en -y menu_token
* Redhat/CentOS/Fedora: find package and repo

Known issues

* There are modules that use same hook as Menu Token, they need to be executed in proper order. For example: Menu per Role works well with a weight of 15.
* Some weird behavior happens when not using absolute paths, please help us solve it once and for all! #2099623: When do you use [site-url] token?

Drupal 7.x and 8.x versions
No longer supported.

Drupal 9.x version
Actively maintained! Please report any issues you have.

Looking for expert advice? (commercial support)
Please contact develCuy.

Acknowledgments

* Development sponsored by Trellon and Dilygent IT.
* The idea started here.

Project Usage
13514
Creation Date
Changed Date
Security Covered
Covered By Security Advisory
Version Available
DEV
Module Summary
Menu Token module provides tokens for use in menu item titles or paths, allowing for dynamic changes based on context or user-defined methods of substitution.
Data Name
menu_token

OPENAI CHATBOT

OPENAI CHATBOT

16:24:08
Generic Chatbot
Hi, I'm a Drupal module expert powered by OpenAI, answering your questions about the Drupal module ecosystem. How can I be helpful today? Please note that we will log your question.