2

In Drupal 7, I've created a content type, with a textfield. In the field settings, I'm invited to add some "Help text", and the description for this specifically says "This field supports tokens".

This field support tokens

However, I'm finding that the tokens are never replaced with actual values. The token just displays literally under the form field.

Node View

I've also been unsuccessful when testing with "simpler" tokens than "current-date". What am I missing?

  • Do you have the Token module installed and enabled? – Lester Peabody Oct 22 '12 at 21:14
  • You have installed a module that implement that feature. Do you know which module is it? – kiamlaluno Oct 22 '12 at 22:19
  • @kiamlaluno I had mistakenly thought that Drupal Core added "This field supports tokens.", however after greping my source tree I see that it is indeed the Token module. – rcourtna Oct 23 '12 at 0:37
  • @LesterPeabody Yes, Token is installed and enabled. – rcourtna Oct 23 '12 at 0:37
1

Tokens in the "Help text" field work, at least for the taxonomy term reference field.

I tried adding "[current-date:long] [current-user:ip-address]" to the help text of a taxonomy reference field, and I obtained the following.

screenshot

Tokens didn't work for the image field, though.

I have also tried with [current-date:custom:e], and it worked.

screenshot

What confused me is that I didn't notice the summary of available tokens I normally expect from the Token module. It doesn't appear for the taxonomy reference field, but it appears for the image field, for which the tokens are not replaced.

screenshot

  • I think I understand. So the sentence "This field supports tokens." is appended to the description of the "Help text" textfield so that the admin/developer knows that they can include this information in whatever help text they write? I was thrown off by the following issue for the Token project, where the issue author states "All other help text fields seem to work just fine [with Tokens]!": drupal.org/node/1796024 – rcourtna Oct 23 '12 at 13:22
  • Thank you for confirming that Tokens do indeed work for taxonomy reference fields. Unfortunately the do not appear to work for other field types, such as textfields and text areas. Strange, it must just be a bug. – rcourtna Oct 23 '12 at 21:48
  • I would say so. I cannot make it work for a text field too. – kiamlaluno Oct 23 '12 at 22:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.