3

I'm getting my nodes directly using db_query (I'm applying some specific conditions), so I can't use the render function allowing me to get the trimmed (or the summary) version of the body that I configured in the Manage display tab of my content type.

For perfomance issue I don't want to use the node_load function on each of my nodes.

Is there a way that I can use a Drupal internal function that would help me to trim the body value?

4

You can get the trimmed summary using text_summary() which will allow you to pass the text, input format and choose the text size (length) you want.

| improve this answer | |

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.