Stored lead specific html in custom field not rendered properly | Community
Skip to main content
Franky_Ruyssch2
Level 4
July 31, 2019
Question

Stored lead specific html in custom field not rendered properly

  • July 31, 2019
  • 1 reply
  • 3062 views

Hi,

I am trying to store lead specific html in a custom field. The html has been generated from excel, and gets imported by a .csv file.

When I try to load the content of that field by using a token in a guided landing page, the content of that field is rendered as if it was text and not html.

I have tried this with 2 types of fields : textarea and string, none of them seem to work.

When you inspect the content you see the following :

It seems that the content starts and end with double quotes.

When i try to edit this content in the inspector I get the following :

How can this be solved?

Thanks

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

1 reply

SanfordWhiteman
Level 10
July 31, 2019

Output the token inside an easily findable container, then read it out (using JS) and rewrite it as HTML.

It's not really "improper" to escape the special characters so the text remains text. It's one of the two options, and Marketo can't know which one you want. It's like textContent vs. innerHTML.

Franky_Ruyssch2
Level 4
August 1, 2019

Thanks for your reply,

used your input to write a jquery solution:

hiddenFromMarketo = $.parseHTML($('#hiddenFromMarketo').text());
$('#displayFromMarketo').html( hiddenFromMarketo );

Franky Ruysschaert
SanfordWhiteman
Level 10
August 1, 2019

OK...  but that's slower and has unnecessary dependencies. This (like most things in 2019) is a job for vanilla JS like that in my blog post.