From 865080f5f652e1734f9a743a6e0e860aacc7fb74 Mon Sep 17 00:00:00 2001 From: Ingolf Steinhardt Date: Wed, 2 Sep 2026 15:56:03 +0200 Subject: [PATCH] Add Twig templates for be_ace_mm and be_tinyMCE_mm Both legacy .html5 templates now have a Twig counterpart, so the Twig-preferred loader picks them up automatically. be_ace_mm mirrors the original inline-script approach (creates the ACE editor div, theme detection, maxLines/minLines from rows, turbo:render rebinding). be_tinyMCE_mm extends core's own @Contao/be_tinyMCE.html.twig and overrides the "custom" block to add max_height from rows, matching the previous PHP template inheritance. Verified with Playwright against the mm_employees devstack: ACE editor renders with correct maxLines/minLines, TinyMCE renders with the max_height override, no JS errors in either case. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_018K6QN9FHjYVFbdRF7PP5fi --- .../contao/templates/be_ace_mm.html.twig | 100 ++++++++++++++++++ .../contao/templates/be_tinyMCE_mm.html.twig | 7 ++ 2 files changed, 107 insertions(+) create mode 100644 src/CoreBundle/Resources/contao/templates/be_ace_mm.html.twig create mode 100644 src/CoreBundle/Resources/contao/templates/be_tinyMCE_mm.html.twig diff --git a/src/CoreBundle/Resources/contao/templates/be_ace_mm.html.twig b/src/CoreBundle/Resources/contao/templates/be_ace_mm.html.twig new file mode 100644 index 000000000..a778e291c --- /dev/null +++ b/src/CoreBundle/Resources/contao/templates/be_ace_mm.html.twig @@ -0,0 +1,100 @@ +{% if enableAce|default %} + {# Use document.write() here in case ACE is loaded in a subpalette (see #1424) #} + + +{% endif %} diff --git a/src/CoreBundle/Resources/contao/templates/be_tinyMCE_mm.html.twig b/src/CoreBundle/Resources/contao/templates/be_tinyMCE_mm.html.twig new file mode 100644 index 000000000..224419706 --- /dev/null +++ b/src/CoreBundle/Resources/contao/templates/be_tinyMCE_mm.html.twig @@ -0,0 +1,7 @@ +{% extends "@Contao/be_tinyMCE.html.twig" %} + +{% block custom %} + {% if rows|default %} + max_height: {{ rows|e('js') }}, + {% endif %} +{% endblock %}