Rule Tokens
Categories
Component ID
2111931
Component name
Rule Tokens
Component type
module
Maintenance status
Development status
Component security advisory coverage
covered
Downloads
3451
Component created
Component changed
Component body
Take control and Rule your Tokens.
The Rule Tokens module allows (mostly) any token to be passed through a Rule component allowing you to change the output as you and your Rule see fit.
Example: If token is 'node:title' and today is Talk like a pirate day, translate the token value.
Â
Required modules
Â
Recommended modules
Â
How to use
- Install/Enable
-
Create a 'Rule' Rules component (admin/config/workflow/rules/components/add) with the following Variables in the following order:
-
Value; The variable containing the Token value which you will be altering:
- Data type
- Text
- Label
- Value
- Machine name
- value
- Usage
- Parameter + Provided
-
(optional) Type; The Token type:
- Data type
- Text
- Label
- Type
- Machine name
- type
- Usage
- Parameter
-
(optional) Token; The Token pattern (without brackets):
- Data type
- Text
- Label
- Token
- Machine name
- token
- Usage
- Parameter
-
(optional) Entity; The Tokens data (Node, User, etc):
- Data type
- [Type of entity]
- Label
- Entity
- Machine name
- entity
- Usage
- Parameter
-
Value; The variable containing the Token value which you will be altering:
- Add any conditions and actions (Data comparison, Set a data value), making any required changes to the 'Value' parameter.
-
Implement your rule token wherever applicable by appending ":rule_tokens:?" to an existing token, where '?' is the machine name of your Rules component.
Example: [node:title] with a component named 'rules_demo' would be invoked as [node:title:rule_tokens:rules_demo].
Â