CMS Development

deanhubspot
メンバー

Output text content from blog summary without HTML/CSS styling

解決

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 いいね!
1件の承認済みベストアンサー
deanhubspot
解決策
メンバー

Output text content from blog summary without HTML/CSS styling

解決

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

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

元の投稿で解決策を見る

1件の返信
deanhubspot
解決策
メンバー

Output text content from blog summary without HTML/CSS styling

解決

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

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