Score:-1

There is no token table

co flag

I installed the latest Drupal 8 version (8.9.18) on my host with the Rules (8.x-3.0-alpha6), the Token, and the Rules Token modules.

I can't see any table showing the list of the allowed tokens, in the rules action form. I want to use the node title or the node author for the Send mail action, but there is no token information or guidance.

I tried to add [node:title] and [node:nid] in the mail body, but they aren't replaced with the node title and the node ID.

What's the problem? How can I resolve it?

Score:1
fr flag

Note: What you refer to as the "token table" is actually a form element (named "token_tree") that is provided by the contributed Token module. You need the contributed Token module in both Drupal 7 and Drupal 8 if you want to use this form element - it is not part of Token module functionality included in core Drupal 8, you still need the contributed Token module.

That said, Token module tokens are not used by Rules in Drupal 8. Instead, Rules uses typed-data Twig tokens, similar to how Views works. See for example https://www.drupal.org/docs/contributed-modules/d8-rules-essentials/token-replacement and related pages in that documentation guide (which includes many examples of how to use these tokens, how to find out what tokens are available, how to modify token values, etc.)

co flag
thanks a lot. it was very helpful for me. but I think there must be a token statement generator in rules page based on twig protocols. exactly same as drupal 7. because nobody can memorize all tokens and for each token I have to go into data selection mode, find a token and then return to direct input and put found token into {{ }}
fr flag
There will eventually be a 'token browser' UI element included in Rules, but that requires someone to do the work and create that UI element. That does not currently exist. If this is important to you, please help in the Rules issue queue.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.