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.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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_examplewith well commented example code for how to implement tokens properly.