How to use token in drupal?

I installed the token module, but I don’t know how to use it. I searched many times and did not find some lessons in it. expect someone to give me an example to use it. especially in view modules. thank.

+3
source share
2 answers

The token module provides a centralized API for using placeholders that are replaced with text. To get started, I suggest reading the documentation module and seeing a list of modules that use the token. Essentially, it accepts the token like [user-name]replacing it with enjoylife or whatever your username is.

You cannot use a token in representations per se. But you can use it in CCK, node body, node title, etc., which, in turn, can be used in Views.

One simple example of tokens is the Pathauto module - go to / admin / build / path / pathauto and check any "Node" suggestions.

+5
source

This will help you better understand what you are trying to accomplish using a token - it is mainly used as an API and, therefore, is a requirement for some really useful Drupal modules, such as Pathauto, as Zerolab offers.

+1
source

Source: https://habr.com/ru/post/1794342/


All Articles