2

I've got an RSS feed that has rich text in it's feed (i.e. paragraph markup, links, etc.) and when the feed is displayed on my website, the markup is not being rendered. Example of markup not being rendered

I am using the Basic theme in SXA.

How do I fix this?

1 Answer 1

3

This component uses external source. The problem here is that raw value from the source is displayed instead of HTML.

To change the way external content is displayed follow these steps:

  1. Find following view file Website\Views\Feed\Feed.cshtml
  2. Open file with your favourite text editor
  3. Find following line
<p class="feed-description">
    @item.Description
</p>
  1. Change it to:
<p class="feed-description">
    @{
        var description = new HtmlString(item.Description);
    }
    @description                            
</p>
2
  • That solved my problem. One additional question that I've got is about maintainability of this solution. How can I make this change in a way that upgrades won't be a problem? Commented Nov 10, 2016 at 21:29
  • It won't be a problem. Once you install a new version of SXA old view will be overwritten by the new one as default installation option is Overwrite. The problem should be fixed in the code so I would say you don't have worry about anything. Commented Nov 10, 2016 at 21:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.