Skip to main content
sportsrbija
Contributor I
Contributor I
May 22, 2024
Solved

Content:encoded

  • May 22, 2024
  • 4 replies
  • 298 views

Hey guys,
I am working on a email template that should be populate with the rss web feed. the problem is the value in the “content:encoded” key from my rss feed contains html tags and when i was testing the template it did not remove the html tags in preview as shown in image

and in email too :
{
  "rss": {
    "@version": "2.0",
    "@xmlns:content": "",
    "@xmlns:wfw": "",
    "@xmlns:dc": "",
    "@xmlns:atom": "",
    "@xmlns:sy": "",
    "@xmlns:slash": "",
    "channel": {
      "title": "Tiket Dana – Sportske Vesti",
      "atom:link": {
        "@href": "",
        "@rel": "self",
        "@type": "application/rss+xml"
      },
      "link": "",
      "description": "",
      "lastBuildDate": "",
      "language": "",
      "sy:updatePeriod": "",
      "sy:updateFrequency": "1",
      "generator": "",
      "item": [
        {
          "title": "",
          "link": "",
          "comments": "",
          "dc:creator": "",
          "pubDate": "",
          "category": "",
          "guid": {
            "@isPermaLink": "",
            "#text": ""
          },
          "description": "",
          "content:encoded": "<div class=\"sport-ispred-teksta-clanka-2 sport-target\" style=\"margin-left: auto; margin-right: auto; text-align: center; \" id=\"sport-1462414046\" data-advadstrackid=\"965\" data-advadstrackbid=\"1\"></strong></h2><div class=\"essb_links essb_displayed_1714071148 essb_share essb_template_default4-retina essb_template_glow-retina essb_766845790 essb_size_m essb_links_center essb_icon_animation5 print-no\" id=\"essb_displayed_1714071148_766845790\" data-essb-postid=\"3298\" data-essb-position=\"1714071148\" data-essb-button-style=\"icon\" data-essb-template=\"default4-retina es


Is there a way that the text in content:encoded can show without html tags in the email?

    This topic has been closed for replies.
    Best answer by Taylor Tarpley

    Hi @sportsrbija

     

    As the expected behavior for an RSS Feed isn’t supposed to strip html tags that come through, I would investigate adjusting your RSS code to not include these tags in the value. 

     

    If you need help working on that code I’d tag one of our Klaviyo partners, or the Champions I linked above to help create that for you! 

     

    -Taylor 

    4 replies

    Taylor Tarpley
    Community Manager
    Community Manager
    May 24, 2024

    Hi @sportsrbija

     

    Welcome to the Community! Happy to help! 

     

    I know that usually a striptag is helpful for getting rid of unwanted HTML that’s pulled in, as Joe mentions in this thread below, but I’ll need to check back w the template team to see if this would specifically help your case here.

     

    Tapping in some of our more developer-minded Champions to see what they have to say here for a possible solution! @Omar @retention @DavidV any ideas here?

     

    -Taylor 

    sportsrbija
    Contributor I
    Contributor I
    May 25, 2024

    HI @Taylor Tarpley ,
    Thanks it did work. But the formatting is gone. Is there any possible way that i can show the text as html intend it to be shown?

    Taylor Tarpley
    Community Manager
    Community Manager
    June 28, 2024

    Hi @sportsrbija

     

    As the expected behavior for an RSS Feed isn’t supposed to strip html tags that come through, I would investigate adjusting your RSS code to not include these tags in the value. 

     

    If you need help working on that code I’d tag one of our Klaviyo partners, or the Champions I linked above to help create that for you! 

     

    -Taylor 

    Contributor I
    November 18, 2024

    @sportsrbija May I ask how you wrote the variable to be able to show the content? I’m new to JSON and I haven’t been able to show the content, I was able to show Title, Description, etc. But not the content:encoded. Is there a specific way to write it?