Search code examples
djangodjango-cms

DjangoCMS render_model with HTML


I'm using Django CMS and the Aldryn News Blog app on a client site to display a blog listing. The default template code uses

{% render_model article "lead_in" %}

to display the "Lead in" excerpt text. However it is displaying p tags for me and I actually need them to render.

https://pasteboard.co/GSq8XObQ.png https://pasteboard.co/GSq8ONF.png

I have tried both:

{% autoescape off %}
{% render_model article "lead_in" %}
{% endautoescape %}



{% render_model article "lead_in" |safe %}

The first does nothing and the second errors out. How can I get it to render the html tags?


Solution

  • Have you tried this solution?

    {{ article.lead_in|safe }}