How to append / prepend into a rich text field I have a rich text field, e.g. for defining an image caption. Now in my template I would like to prepend some text to the content of the rich text field, e.g. Figure 1: [rich text]. Is this possible? The content of the paragraph-tag of the rich text field should include the prepended text.
If you want to prepend another paragraph you could to this:

{% set paragraphs = entry.body|split('&lt;/p&gt;') %}
{% for paragraph in paragraphs %}
  {% if loop.index == 1%}
    &lt;p&gt;Prepended Custom Text&lt;/p&gt;
  {% endif %}
    {{paragraph|raw}}
{% endfor %}


If you want to display a custom string in the first paragraph itself you could do this:

{% set paragraphs = entry.body|split('&lt;/p&gt;') %}
{% for paragraph in paragraphs %}
  {% if loop.index == 1%}
    {% set paragraph = paragraph|replace({'&lt;p&gt;': '&lt;p&gt;My custom prepended Text '}) %}
  {% endif %}
    {{paragraph|raw}}
{% endfor %}


This looks a little bit hacky tough there are probably prettier ways to do so.