Good way to transfer html in template component to rich text component?

  • 2
  • Question
  • Updated 3 years ago
  • Answered
I have a few large HTML templates that I'd like to transition over to rich text components. Is there an easy way to do that? just copying and pasting the content doesn't work.. I end up with html tags in the rich text. I couldn't find a way to edit the html source of the rich text? 
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb

Posted 3 years ago

  • 2
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
Ideas. 
1. Preview your templates (in the run time)  and copy what you want.   This way no html code is present.   Copy this back into the RTC.

2. Maybe take the run time version copy and paste it into MS word first.  (I shudder...)

3. Finally if you look at the RTC in the XML you'll see the HTML code.  Its just all url encoded so it doesn't break the XML structure.  You could take your template HTML and run it through a URLEncoder, and then paste that mess into the XML of the RTC. 

I better stop.  this is getting really hacky. 
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
#3 might be the way I have to go. Using the runtime version isn't a good option because I've got a lot of conditional merge syntax.
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
Update:

The easiest way to accomplish this is to just open the XML and copy from the <contents> of the template to the <contents> of the rich text. You don't need to go through an html encoder, because the html of the template component is already encoded.