<p>Try something like </p>

<pre><code>{{ (entry.body | slice(0, 500) ~ '...') | markdown }}
</code></pre>

CC BY-SA 3.0
2016-03-19T19:40:53.667Z
This is probably really close, but it's not converting it to markdown. Is there a smarter way of outputting the Rich Text's content?
jasonetco
CC BY-SA 3.0
2016-03-19T19:51:42.733Z
This works perfectly: `{{ (entry.body | slice(0, 500) ~ '...') | markdown }}`
jasonetco
CC BY-SA 3.0
2016-03-19T19:24:55.293Z
2016-03-19T21:39:00.810Z
2016-03-19T21:39:00.810Z
Seán O'Grady
<p>You might find the Hacksaw plugin useful for this <a href="https://github.com/ehousestudio/craft_hacksaw/" rel="nofollow">https://github.com/ehousestudio/craft_hacksaw/</a> this will truncate text for you and has a wealth of options available for doing so, specifically the <code>append</code> parameter, which will do exactly what you want :)</p>

CC BY-SA 3.0
2016-03-19T19:41:25.153Z
Cool, thanks! I'd rather not use a plugin, but this will be my back up answer :)
jasonetco
CC BY-SA 3.0
2016-03-19T19:23:56.453Z
2016-03-19T19:23:56.453Z
Alec Ritson
<p>I'm using the following code in my template to truncate the body of an entry (coming from a Rich Text field):</p>

<p><code>{{ entry.body | slice(0, 500) | markdown }}</code></p>

<p>To this, I'd like to add <code>...</code> as a string, so that it will output like:</p>

<p><code>Words words words...</code></p>

<p>Since the field part I'm using outputs into its own <code>&lt;p&gt;</code> tag, adding the <code>...</code> into the HTML itself has them sitting in two different tags. I've tried using <code>|join</code> but I must be doing something wrong, its putting the first part into a separate <code>&lt;p&gt;</code> tag than the <code>...</code></p>

<p>Thanks for your help!</p>

<templating><filter>
Add '...' to template field
# Add '...' to template field

(Asked by: username_0 on 2016-03-19)

I'm using the following code in my template to truncate the body of an entry (coming from a Rich Text field):

`{{ entry.body | slice(0, 500) | markdown }}`

To this, I'd like to add `...` as a string, so that it will output like:

`Words words words...`

Since the field part I'm using outputs into its own  tag, adding the `...` into the HTML itself has them sitting in two different tags. I've tried using `|join` but I must be doing something wrong, its putting the first part into a separate  tag than the `...`

Thanks for your help!

**Tags:** templating, filter

---

## 2 answers

### Answer by username_1 on 2016-03-19. Score: 2 | Accepted answer

Try something like 
{{ (entry.body | slice(0, 500) ~ '...') | markdown }}

> **Comments:**
> **username_0**: This is probably really close, but it's not converting it to markdown. Is there a smarter way of outputting the Rich Text's content?  
> **username_0**: This works perfectly: `{{ (entry.body | slice(0, 500) ~ '...') | markdown }}`  

---

### Answer by username_2 on 2016-03-19. Score: 3

You might find the Hacksaw plugin useful for this <https://github.com/ehousestudio/craft_hacksaw/> this will truncate text for you and has a wealth of options available for doing so, specifically the `append` parameter, which will do exactly what you want :)

> **Comments:**
> **username_0**: Cool, thanks! I'd rather not use a plugin, but this will be my back up answer :)  

---

