diff --git a/src/MadeYourDay/Contao/CustomElements.php b/src/MadeYourDay/Contao/CustomElements.php index 2725090..1c00484 100644 --- a/src/MadeYourDay/Contao/CustomElements.php +++ b/src/MadeYourDay/Contao/CustomElements.php @@ -745,6 +745,9 @@ public static function loadConfig() if (in_array('content', $types)) { $contents[] = '$GLOBALS[\'TL_CTE\'][\'' . $contentCategory . '\'][\'' . $template . '\'] = \'MadeYourDay\\\\Contao\\\\Element\\\\CustomElement\';'; $contents[] = '$GLOBALS[\'TL_LANG\'][\'CTE\'][\'' . $template . '\'] = ' . var_export($label, true) . ';'; + if (!empty($config['wrapper']['type'])) { + $contents[] = '$GLOBALS[\'TL_WRAPPERS\'][' . var_export($config['wrapper']['type'], true) . '][] = ' . var_export($template, true) . ';'; + } } if (in_array('module', $types)) { $contents[] = '$GLOBALS[\'FE_MOD\'][\'' . $moduleCategory . '\'][\'' . $template . '\'] = \'MadeYourDay\\\\Contao\\\\Element\\\\CustomElement\';'; diff --git a/src/MadeYourDay/Contao/Element/CustomElement.php b/src/MadeYourDay/Contao/Element/CustomElement.php index 09a9642..eb4e0b6 100644 --- a/src/MadeYourDay/Contao/Element/CustomElement.php +++ b/src/MadeYourDay/Contao/Element/CustomElement.php @@ -31,6 +31,14 @@ public function generate() { $this->strTemplate = $this->type; + if (TL_MODE === 'BE' && ( + in_array($this->type, $GLOBALS['TL_WRAPPERS']['start']) + || in_array($this->type, $GLOBALS['TL_WRAPPERS']['stop']) + || in_array($this->type, $GLOBALS['TL_WRAPPERS']['separator']) + )) { + return ''; + } + try { return parent::generate(); }