Olivier Massot 4 лет назад
Родитель
Сommit
da7be3d4df

+ 1 - 3
ot_templating/Classes/ViewHelpers/Template/CurrentViewHelper.php

@@ -36,9 +36,7 @@ class CurrentViewHelper extends OtAbstractViewHelper
         Closure $renderChildrenClosure,
         RenderingContextInterface $renderingContext
     ) {
-        $pageRepository = GeneralUtility::makeInstance(ObjectManager::class)->get(OtWebsiteRepository::class);
-        $website = $pageRepository->getCurrentWebsiteFromFEGlobals();
-
+        $website = $GLOBALS['TYPO3_REQUEST']->getAttribute('ot_website');
         $templateRepository = GeneralUtility::makeInstance(ObjectManager::class)->get(TemplateRepository::class);
         return $templateRepository->getTemplate($website);
     }

+ 5 - 4
ot_templating/Resources/Private/Templates/Content/ShareBar.html

@@ -1,9 +1,10 @@
-<f:comment><!-- Widget flux: : Share Bar --></f:comment>
-
 {namespace v=FluidTYPO3\Vhs\ViewHelpers}
 {namespace flux=FluidTYPO3\Flux\ViewHelpers}
+{namespace ot=Opentalent\OtTemplating\ViewHelpers}
+
+<f:comment><!-- Widget flux: : Share Bar --></f:comment>
 
-<f:layout name="{settings.template}/CustomContent" />
+<f:layout name="{ot:template.current()}/CustomContent" />
 
 <f:section name="Configuration">
   <flux:form id="ShareBar"
@@ -21,5 +22,5 @@
 </f:section>
 
 <f:section name="Main">
-  <f:render partial="{settings.template}/ShareBar"/>
+  <f:render partial="{ot:template.current()}/ShareBar"/>
 </f:section>