Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

78
Views
Custom tags in TinyMCE WYSWYG

I have an application which help our user to format the email template. A sample email template looks like this:

Dear <FirstName> <LastName>:    

Thank you for your entry <Title> and your order number is <OrderID>....

These are saved in our database as Text. The issue is when i try to load this text in simple Textarea it works fine when i try to display this text in TinyMCE editor textarea it cuts off when it see the first "<" and display something like this:

Dear :    

Thank you for your entry and your order number is .... 

TinyMCE dose not render the tags. i dont know how to render the custom tags and they are not <abc> </abc> tags. Our system will replace the "<SomeValue>" with the actual value based on the tag and send the email to the client.

I tried replacing the "<" and ">" to "&lt;" and "&gt;" and its not working. I also tried them replacing it to "<code>&lt;" and "&gt;</code>" before i bind the textarea but that is not working either. I have added "code" plugin while declaring my TinyMCE in javascript. Do i need anything else, any specially "entity_encoding"? I tried "raw" and "html" nothings works. here is my javascript

 <script>
        tinymce.init({
            selector: '#mytextarea',
           
            entity_encoding: "html",
            plugins: "code",
            toolbar: 'code'
        });
    </script>

Any help is appreciated as i have spend two days searching the web and trying bunch of things.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

If you want TinyMCE to treat these elements like HTML tags you need to define them as custom tags:

https://www.tiny.cloud/docs/configure/content-filtering/#custom_elements

An alternative which may take less effort to setup is to use another syntax (e.g. {first_name}) along with marking that text as non-editable so that TinyMCE treats the entire string like one "character" in the UI.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!