Mam problem z TinyMce w połączeniu z Twig, Próbuję wkleić html z tagami twig w tinyMce. (Przy użyciu surowego html)Jak pisać znaczniki gałązki wewnątrz TinyMCE
tutaj jest to, co chcę w wyniku:
<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>
Jak to wygląda, kiedy wkleić go do TinyMCE i zatwierdź mój 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>
jak ty widzę, tinyMce przesuwa moje tagi z gałązkami poza stół i łamie całą logikę, którą chciałem zrobić.
Próbowałem konfiguracji severals dla tinyMce (cleanup : false
), a także wersje partycji (3.x, 4.x) bezpośrednio na oficjalnej stronie. Ale to nie działa
Dziękuję za pomoc.
Jak wkleić zawartość HTML gałązka w TinyMCE? Czy używałeś 'raw'? – Javad