Answers.Body: <p>You can use any Twig in the dynamic title field. There are plugins that provide Twig filters to truncate text, but here’s how you can do simple truncation without any plugin.</p>
  
  <pre><code>{{ object.myTextField|length &gt; 50 ? object.myTextField|slice(0, 50) ~ '...' : object.myTextField }}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-06-30T18:37:22.020Z
Answers.LastActivityDate: 2016-06-30T18:37:22.020Z
Answers.UserDisplayName: carlcs
Body: <p>I am auto-generating entry titles based on a plain text field. Now, I would like to limit the characters the title contains of (e.g. 50 chars while the plain text field has 500 chars). How could I do that?</p>
  
  <p>Thank you very much for your help.</p>
  
Tags: <titles><auto-generate>
Title: How to truncate auto-generated entry titles?
ThreadText: # How to truncate auto-generated entry titles?
  
  (Asked by: username_0 on 2016-06-30)
  
  I am auto-generating entry titles based on a plain text field. Now, I would like to limit the characters the title contains of (e.g. 50 chars while the plain text field has 500 chars). How could I do that?
  
  Thank you very much for your help.
  
  **Tags:** titles, auto-generate
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2016-06-30. Score: 8 | Accepted answer
  
  You can use any Twig in the dynamic title field. There are plugins that provide Twig filters to truncate text, but here’s how you can do simple truncation without any plugin.
  
  ```
  {{ object.myTextField|length > 50 ? object.myTextField|slice(0, 50) ~ '...' : object.myTextField }}
  
  ```
  
  
  ---
  
  