Provides an alternative Token browser element using HTMX for requests. Browse all tokens available on your site with no depth limitations.
Features
- Browse deep nested tokens beyond the default recursion depth limit without crashing your site.
- Visit the help page on your site at
/admin/help/token_browserto see all available tokens. - For Developers: Provides an alternative theme function to attach token browser functionality to form fields.
Replace'#theme' => 'token_tree_link'
With'#theme' => 'token_browser_link'
Example:$form['tokens'] = [ '#theme' => 'token_browser_link', '#token_types' => ['node', 'user'], '#global_types' => TRUE, ]; -
As of version 1.0.1, administrators can globally alter the theme registry for every existing
token_tree_linkto automatically use this token browser. The settings form is available at/admin/config/user-interface/token-browser - As of version 1.0.2, administrators can set the size of the token browser modal when enabled globally.
Quick Start
To use this token browser everywhere on your site, do the following:
- Navigate to the settings form at
/admin/config/user-interface/token-browser. - Check the box Replace Token module's default browser sitewide (enabled by default).
- Check the box Force recursion limit. This is recommended.
- Optionally override Dialog options (defaults: Width = 800, Height = 500).
- Click Save configuration button.
- Anywhere you see a Browse available tokens link will now point to the Token browser route.
Integrations
These modules will automatically use the token browser form element provided by this module where applicable:
Similar projects
Fast Token Browser
This was a Drupal 7 module that never got ported but claims to achieve the same objective using ajax. My module uses the new HTMX library in Drupal core and completely eliminate the need for any Jquery.
Project information
- Project categories: Content editing experience, Developer tools, Performance
73 sites report using this module
- Created by apmsooner on , updated
Stable releases for this project are covered by the security advisory policy.
Look for the shield icon below.
