Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

85
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda