Browse code

Inject modal code in global TL_BODY instead of returning it inside the page structure

Benjamin Roth authored on11/01/2023 09:31:57
Showing2 changed files
... ...
@@ -60,7 +60,9 @@ class ModalElementController extends AbstractContentElementController
60 60
 
61 61
         $template->modal_configuration = $modal->row();
62 62
 
63
-        return $template->getResponse();
63
+        $GLOBALS['TL_BODY'][] = $template->parse();
64
+
65
+        return new Response();
64 66
     }
65 67
 
66 68
 }
... ...
@@ -61,7 +61,9 @@ class ModalModuleController extends AbstractFrontendModuleController
61 61
 
62 62
         $template->modal_configuration = $modal->row();
63 63
 
64
-        return $template->getResponse();
64
+        $GLOBALS['TL_BODY'][] = $template->parse();
65
+
66
+        return new Response();
65 67
     }
66 68
 
67 69
 }