3

Is there a token for the body of a content type? I'm using the Integrated Metatags module. I want to include some of the body text inside of the Meta Description tag.

2

There is a feature request opened for the Token module: Token for body of node. Essentially, the reason it has not been implemented is performance issues, as modules are queried for the values of the tokens they implement, independently from the fact those tokens have been requested. This means the content for, e.g., [body] would be generated even if the string passed to Token doesn't contain that tag.
The Drupal 7 code that handles tokens is changed, and the modules that implement tokens gets the list of tokens that need to be replaced; the content of tokens that are expensive to generate is generated only when required.

In short, the only module that could implement that kind of token is the Token module, but so far it doesn't implement it for implementation issues. Any other module that implements it would have the same performance issues.

1
  • When I say " the only module that could implement that kind of token is the Token module," I don't mean that other modules could not implement that token. The Token module is the module the API to handle tokens, and that implements the basic tokens for users, nodes, and taxonomy terms; therefore, it is the module I would expect to implement a token for the body content of nodes. – apaderno Jul 5 '11 at 19:34

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.