Elements do not show html tags in excerpt, tags are stripped

Updated: August 18, 2016

Most of Elements that you can find in page builder like Portfolio, Items, Members, Posts, Services etc… strip html tags from content text if they are displayed via Element on frontend of website. It’s because of design and other reasons. In the list of posts is simply no space to show some styled html content, that’s why rather simple text is displayed, and styled content is displayed on detail page of post.

Anyway, if you would like to change that yourself, you have to disable function that strip html tags in source code.

Source codes related to element you can usually find in theme folder on path like ./ait-theme/elements/ where you should navigate to subfolder of desired element and open .latte file that is usually named like name-of-element.latte

The part of code that strip html tags from content/excerpt is |striptags.
For example:

<div class="item-excerpt"><p>{!$item->excerpt(200)|striptags}</p></div>

change to:

<div class="item-excerpt"><p>{!$item->excerpt(200)}</p></div>

Author: Dodo Sofranko

Support Staff