I have a problem with TinyMce in combination with Twig, I am trying to insert html with tweak tags in tinyMce. (using raw html)
here is what i want as a result:
<table> <thead> <tr> <th></th> {% for period in report.periods %} <th> {% set per = "last_" ~ period %} {{ per | trans({}, "admin") }} </th> {% endfor %} </tr> </thead> <tbody> {% for category in report.categories %} <tr> <td> <b>{{ category | trans({}, "admin") }}</b> </td> {% for period in report.periods %} <td> {{ data[category][period] }} </td> {% endfor %} </tr> {% endfor %} </tbody> </table>
This is what it looks like when I paste it into tinyMce and test my HTML
<p>{% for period in report.periods %} {% endfor %} {% for category in report.categories %} {% for period in report.periods %} {% endfor %} {% endfor %}</p> <table> <thead> <tr> <th></th><th>{% set per = "last_" ~ period %} {{ per | trans({}, "admin") }} </th> </tr> </thead> <tbody> <tr> <td><b>{{ category | trans({}, "admin") }}</b></td> <td>{{ data[category][period] }}</td> </tr> </tbody> </table>
As you can see, tinyMce moves my twig tags out of the table and breaks all the logic I wanted to do.
I tried the configuration for individual tinyMce files ( cleanup : false ), as well as versions with several versions (3.x, 4.x) directly on the official website. But that does not work.
Thank you for your help.
Jaybe source share