Do you need to create the most basic of tokens? Do you need to be able to create a token that perhaps outputs just a single phrase or a even a single word? I needed to create a token for a piece of plain text information that would appear in multiple places all over my site, but was very likely to change from time to time. This is how I did it:

1. Go to Admin > Structure > Custom Token, click on Add Token
2. Enter a Token Name and Description
3. Choose "Custom Tokens" for the Token Type
4. In the PHP Replacement text area enter something like this:

$basictoken = 'My simple phrase or text';
return $basictoken;

5. Hit "Save Token"

Back on the Custom Token main page you will now see your custom token outputted in the "demo" column. You can use this new token as an input filter if you have the Token Filter module installed.

The token will be [custom:basictoken]

Comments

tukusejssirs’s picture

I try to accomplish something like that.

I added a new custom token with:

- token name: test
- token description: test
- token type: custom
- text format: php code
- content:
return $basictoken;

But there's nothing in the Demo column.

I have installed Drupal 7.59, Custom Tokens. I read about Paranoia module, but I couldn't find it in my database.