Is there a way to output only the first paragraph of a Rich Text field? I have a rich text output section I want to limit to the first paragraph so I can link to a full version on another page. What's the best way to do this?
You can do this entirely with Twig.

First, use the |split filter to split your HTML into an array of paragraphs, on their closing &lt;/p&gt; tags:

{% set paragraphs = entry.myRichTextField|split('&lt;/p&gt;') %}


Then, you can assign the first paragraph to a new variable using the |first filter. And don’t forget to bring back that missing &lt;/p&gt;.

{% set firstParagraph = paragraphs|first ~ '&lt;/p&gt;' %}


Finally, you can output that. Use the |raw filter so that Twig doesn’t encode the HTML entities.

{{ firstParagraph|raw }}