How do I create a custom token in Drupal 7?
I need to create a custom token that can fetch a value from a mapping table based on nids. I need开发者_运维百科 to know the hooks I should implement to create the custom token.
You'll need to implement hook_token_info() and hook_tokens.
The best thing you can do is download the Examples module, there's a module called token_example
with well commented example code for how to implement tokens properly.
精彩评论