CMS Development

deanhubspot
Member

Output text content from blog summary without HTML/CSS styling

SOLVE

On my blog listing pages I have the summary shown, but some posts have large <h2> elements at the top, which look funny on the listing page. Is there a way to unstyle the post_summary field? 

 

Relevant code:

<div class="post-preview">
    {{ rec_post.post_summary|truncatehtml(100) }}
</div>
0 Upvotes
1 Accepted solution
deanhubspot
Solution
Member

Output text content from blog summary without HTML/CSS styling

SOLVE

Never mind, I have solved my own problem. There is the "striptags" filter that will do this. 

{{ rec_post.post_summary|striptags|truncatehtml(100) }}

View solution in original post

1 Reply 1
deanhubspot
Solution
Member

Output text content from blog summary without HTML/CSS styling

SOLVE

Never mind, I have solved my own problem. There is the "striptags" filter that will do this. 

{{ rec_post.post_summary|striptags|truncatehtml(100) }}