diff --git a/README.md b/README.md index 39d5388..ff7b3fe 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,9 @@ # contao-inserttags -New, clean insert tag handling, adding some custom logic to existing insert tags in Contao 4. +New, clean insert tag handling, adding some custom logic to existing insert tags in Contao 4.x + +Also activates rendering of insert tags in the backend - especially nice for custom elements, included subtemplates, icons and many more tricks in content element organisation. + +Does not replace it on any kind of backend action that depends on insert tags, and we're not touching the HTML element - that usually is modules or other "bigger" includes. ###New tags diff --git a/src/EventListener/ParseBackendTemplateListener.php b/src/EventListener/ParseBackendTemplateListener.php index 71e099e..eb6fad3 100644 --- a/src/EventListener/ParseBackendTemplateListener.php +++ b/src/EventListener/ParseBackendTemplateListener.php @@ -14,12 +14,15 @@ class ParseBackendTemplateListener public function __invoke(string $buffer, string $template): string { if ('be_main' === $template) { - // modify only if we're not in any action mode + // modify only if we're not in any action mode, popup or dynamic context // modify only if there is no HTML content element involved - if(!Input::get('act') + if( + !Input::get('act') + AND !Input::get('context') + AND !Input::get('picker') AND strpos($buffer, '
HTML
') === false AND strpos($buffer, '
HTML
') === false - ){ + ){ $objIt = new InsertTags(); $buffer = $objIt->replace($buffer, true); }