0

I'd like to be able to use tokens with entities, similar to how they work for node right out of the box with core. However, for whatever reason, entity tokens are not available to me even though I have Entity API and Entity Token enabled.

Is there something that needs configuration? I see no way to configure Entity Token.

0

The problem was that theme_token_tree($variables) was being passed only a subset of available tokens. Just a gotcha to look out for if you haven't done work with the token tree before.

$variables = array('token_types' => array('nodes','comments'), 'global_types' => FALSE);
theme_token_tree($variables);

I needed to add additional token types to the token types array, like so:

$variables = array('token_types' => array('nodes','comments','bean'), 'global_types' => FALSE);
theme_token_tree($variables);

You can also go to /admin/help/token to get a list of all available tokens. Be warned though, unless you have enough memory allocated to MySQL it could consume all of it and give you a "MySQL gone away" error. I received that error and I upped mine to 500MB locally and it was fine after that.

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.