Skip to main content
Tweeted twitter.com/#!/StackDrupal/status/221100123780943874
Removed the teaser tag. I don't want a teaser, I want access to the trimmed body text.
Source Link
Kenny Wyland
  • 3.1k
  • 5
  • 40
  • 72

I load an Article node with node_load() and I'd like to get the summary for the Body field. I know that I can access it with $node->body[$node->language][0]['summary'] but unless the user explicitly adds a Summary Body, then this field is empty.

I know that drupal will automatically generate a "trimmed body" if they don't add a Summary Body. How can I access that trimmed body?

EDIT:

I'm not interesting in render()ing the content, I just want the text. My module is generating a json feed for an external source.

I load an Article node with node_load() and I'd like to get the summary for the Body field. I know that I can access it with $node->body[$node->language][0]['summary'] but unless the user explicitly adds a Summary Body, then this field is empty.

I know that drupal will automatically generate a "trimmed body" if they don't add a Summary Body. How can I access that trimmed body?

I load an Article node with node_load() and I'd like to get the summary for the Body field. I know that I can access it with $node->body[$node->language][0]['summary'] but unless the user explicitly adds a Summary Body, then this field is empty.

I know that drupal will automatically generate a "trimmed body" if they don't add a Summary Body. How can I access that trimmed body?

EDIT:

I'm not interesting in render()ing the content, I just want the text. My module is generating a json feed for an external source.

Source Link
Kenny Wyland
  • 3.1k
  • 5
  • 40
  • 72

Getting the auto summary from a node body

I load an Article node with node_load() and I'd like to get the summary for the Body field. I know that I can access it with $node->body[$node->language][0]['summary'] but unless the user explicitly adds a Summary Body, then this field is empty.

I know that drupal will automatically generate a "trimmed body" if they don't add a Summary Body. How can I access that trimmed body?