Access trimmed description in module I have a content type with a Long text and summary field. In the node view display, it is set to to show as Summary or trimmed.

I have a module that gets all the nodes of that content type. 

How do I programmatically get the trimmed value of that field? Using var_dump(), I get the following output.

  ["field_description"]=&gt;
  array(1) {
    ["und"]=&gt;
    array(1) {
      [0]=&gt;
      array(5) {
        ["value"]=&gt;
        string(5763) "&lt;p&gt;Test user DescriptionTest&lt;/p&gt;"
        ["summary"]=&gt;
        string(0) ""
        ["format"]=&gt;
        string(9) "full_html"
        ["safe_value"]=&gt;
        string(5764) "&lt;p&gt;Test user Description&lt;/p&gt;"
        ["safe_summary"]=&gt;
        string(0) ""
      }
    }
The summary value will only be set if someone has actually filled out the summary textfield when editing the node. You'll need to do the trimming yourself in code. Drupal has functions such as https://api.drupal.org/api/drupal/modules%21field%21modules%21text%21text.module/function/text_summary/7.x or views has https://api.drupal.org/api/views/views.module/function/views_trim_text/7.x-3.x

So you'll need to do a check to see if the summary value exists, if it doesnt use the main text and trim it with the functions or something similar above