|
|
@@ -8,10 +8,6 @@ use Opentalent\OtCore\Website\OtPageRepository;
|
|
|
use Opentalent\OtCore\ViewHelpers\OtAbstractViewHelper;
|
|
|
use Opentalent\OtCore\Website\OtWebsiteRepository;
|
|
|
use Opentalent\OtTemplating\ViewHelpers\RootPage\GetIdViewHelper;
|
|
|
-use TYPO3\CMS\Core\Utility\GeneralUtility;
|
|
|
-use TYPO3\CMS\Extbase\Object\ObjectManager;
|
|
|
-use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
|
|
|
-use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
|
|
|
|
|
|
/**
|
|
|
* Returns the uid of the page with the given slug
|
|
|
@@ -28,6 +24,7 @@ class GetPageUidViewHelper extends OtAbstractViewHelper
|
|
|
{
|
|
|
public function __construct(
|
|
|
private readonly OtPageRepository $otPageRepository,
|
|
|
+ private readonly OtWebsiteRepository $otWebsiteRepository,
|
|
|
) {}
|
|
|
|
|
|
/**
|
|
|
@@ -52,11 +49,7 @@ class GetPageUidViewHelper extends OtAbstractViewHelper
|
|
|
*/
|
|
|
public function render(): ?int
|
|
|
{
|
|
|
- $rootId = GetIdViewHelper::renderStatic(
|
|
|
- $this->arguments,
|
|
|
- $this->renderChildrenClosure,
|
|
|
- $this->renderingContext
|
|
|
- );
|
|
|
+ $rootId = $this->otWebsiteRepository->getCurrentRootpageUidFromFEGlobals();
|
|
|
|
|
|
$subpages = $this->otPageRepository->getAllSubpagesForPage($rootId);
|
|
|
|