From c5c89cc9520b662ad9669bd692519b9855b9094b Mon Sep 17 00:00:00 2001 From: veronikaplenta Date: Wed, 8 May 2024 11:41:14 +0200 Subject: [PATCH] Use frontend module/content element type as CSS class again --- .../ContentElement/AbstractContentElementController.php | 2 +- .../FrontendModule/AbstractFrontendModuleController.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core-bundle/src/Controller/ContentElement/AbstractContentElementController.php b/core-bundle/src/Controller/ContentElement/AbstractContentElementController.php index 5bb466f5956..b6014dec94a 100644 --- a/core-bundle/src/Controller/ContentElement/AbstractContentElementController.php +++ b/core-bundle/src/Controller/ContentElement/AbstractContentElementController.php @@ -72,7 +72,7 @@ protected function addDefaultDataToTemplate(FragmentTemplate $template, array $m if ($this->isLegacyTemplate($template->getName())) { // Legacy fragments $this->addHeadlineToTemplate($template, $modelData['headline'] ?? null); - $this->addCssAttributesToTemplate($template, $template->getName(), $modelData['cssID'] ?? null, $classes); + $this->addCssAttributesToTemplate($template, 'ce_'.$this->getType(), $modelData['cssID'] ?? null, $classes); $this->addPropertiesToTemplate($template, $properties); $this->addSectionToTemplate($template, $section); diff --git a/core-bundle/src/Controller/FrontendModule/AbstractFrontendModuleController.php b/core-bundle/src/Controller/FrontendModule/AbstractFrontendModuleController.php index 3443943fe38..dd1cadd36e3 100644 --- a/core-bundle/src/Controller/FrontendModule/AbstractFrontendModuleController.php +++ b/core-bundle/src/Controller/FrontendModule/AbstractFrontendModuleController.php @@ -77,7 +77,7 @@ protected function addDefaultDataToTemplate(FragmentTemplate $template, array $m if ($this->isLegacyTemplate($template->getName())) { // Legacy fragments $this->addHeadlineToTemplate($template, $modelData['headline'] ?? null); - $this->addCssAttributesToTemplate($template, $template->getName(), $modelData['cssID'] ?? null, $classes); + $this->addCssAttributesToTemplate($template, 'mod_'.$this->getType(), $modelData['cssID'] ?? null, $classes); $this->addPropertiesToTemplate($template, $properties); $this->addSectionToTemplate($template, $section);