|
@@ -2,15 +2,9 @@
|
|
|
|
|
|
|
|
namespace Opentalent\OtTemplating\ViewHelpers\Page;
|
|
namespace Opentalent\OtTemplating\ViewHelpers\Page;
|
|
|
|
|
|
|
|
-
|
|
|
|
|
-use Closure;
|
|
|
|
|
use Opentalent\OtCore\Website\OtPageRepository;
|
|
use Opentalent\OtCore\Website\OtPageRepository;
|
|
|
use Opentalent\OtCore\ViewHelpers\OtAbstractViewHelper;
|
|
use Opentalent\OtCore\ViewHelpers\OtAbstractViewHelper;
|
|
|
use Opentalent\OtCore\Website\OtWebsiteRepository;
|
|
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;
|
|
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* Returns the uid of the first page with the given template in the current website, or null if none
|
|
* Returns the uid of the first page with the given template in the current website, or null if none
|
|
@@ -25,6 +19,7 @@ class GetFirstWithTemplateViewHelper extends OtAbstractViewHelper
|
|
|
{
|
|
{
|
|
|
public function __construct(
|
|
public function __construct(
|
|
|
private readonly OtPageRepository $otPageRepository,
|
|
private readonly OtPageRepository $otPageRepository,
|
|
|
|
|
+ private readonly OtWebsiteRepository $otWebsiteRepository,
|
|
|
) {}
|
|
) {}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -49,11 +44,7 @@ class GetFirstWithTemplateViewHelper extends OtAbstractViewHelper
|
|
|
*/
|
|
*/
|
|
|
public function render(): ?int
|
|
public function render(): ?int
|
|
|
{
|
|
{
|
|
|
- $rootId = GetIdViewHelper::renderStatic(
|
|
|
|
|
- $this->arguments,
|
|
|
|
|
- $this->renderChildrenClosure,
|
|
|
|
|
- $this->renderingContext
|
|
|
|
|
- );
|
|
|
|
|
|
|
+ $rootId = $this->otWebsiteRepository->getCurrentRootpageUidFromFEGlobals();
|
|
|
|
|
|
|
|
$subpages = $this->otPageRepository->getAllSubpagesForPage($rootId);
|
|
$subpages = $this->otPageRepository->getAllSubpagesForPage($rootId);
|
|
|
|
|
|