Hi,

Thank you, thank you, thank you!!! I just discovered "Token Filter" and "Custom Tokens". Together these modules are providing a capability I've been searching for since starting into Drupal a couple of months ago.

Now my suggestion: It would be helpful if you would add something like the following to your project page:

How to use the Token Filter module


  • Install and enable the module.
  • Go to "Configuration > Content authoring > Text formats". Configure (or add) a text format that is only available to trusted users of your site. (Use of tokens by untrusted users is a security risk.) You will find a new filter available called "Replace tokens". Select that filter and click "Save configuration".
  • Go to "Help > Token" to get a list of tokens available. There you will get a table with three columns: Name, Token, and Description. The name column at first provides a list of token types. Click the small arrow to left of any type name to get a list of tokens of that type. The items that appear in the "Token" column are the text you need to enter in the next step.
  • Go to any content of your site, such as a page or an article. For the Body, select the text format that you just configured. Now enter some text that includes any of the items in the "Token" column of the previous step. Click "Save".
  • Marvel that the token text has been replaced with its calculated value!
  • If the tokens in that list aren't enough and you need to define your own, get the "Custom Tokens" module.

That would have saved me a lot of head-scratching once I enabled the module and thought, "Okay, now what?"

Comments

vonn.new’s picture

Thank you! Your little documentation here saved me a lot of headaches.

darvanen’s picture

Title: Token Filter: Some suggested explanation » Create documentation
Status: Active » Needs work
Related issues: +#1304764: Update the README.txt file

I agree that some more documentation is needed, however the documentation pages and readme file are the proper place for that.

Thanks for the suggested wording, I will probably use some of it when I can get around to creating the documentation pages.

If anyone is super keen I'm happy to create blank pages for them to edit.

darvanen’s picture

From #2084337: Use updated terminology in description:

@kari.kaariainen says:
In the description it says "Token Filter is a very simple module to make token values available as an input filter." "Input filter" should be changed to "Text format filter" to avoid confusion for Drupal 7 users.

@silurius says:
Additionally, README.txt should be updated as follows:

Change:

2) Go to /admin/settings/filters and enable the token_filter for any of your existing filter type or if you wish, create a new one.

Replace with: 2) Go to /admin/config/content/formats and enable "Replace tokens" for the Text formats in which you wish to make token values available.

Change: Then in the text where you use that input filter you can use substitution tokens with

Replace with: Then in a field using a text format with "Replace tokens" checked, you can use substitution tokens with

pmoz’s picture

Thank you for some clarity to the OP.
Agreed that the readme is not sufficient or clear enough.

Webbeh’s picture

Version: 7.x-1.1 » 8.x-1.x-dev

> If anyone is super keen I'm happy to create blank pages for them to edit.

Happy to assist with this. Do we want to push this to the 8.x branch instead?

darvanen’s picture

Apologies for the delay @Webbeh, here's the stub, ready to be filled out:

https://www.drupal.org/docs/contributed-modules/token-filter

darvanen’s picture

darvanen’s picture

.

darvanen credited silurius.

darvanen’s picture

darvanen’s picture

Thanks @camerongreen for getting a start going on the documentation page, you may be interested in the small discussion here.

I've added credit for you, and others who have given constructive input.

darvanen’s picture

Title: Create documentation » Complete documentation
darvanen’s picture

Version: 8.x-1.x-dev » 2.x-dev