registerArgument('slug', 'string', 'The slug of the researched page', true); } /** * @param array $arguments * @param \Closure $renderChildrenClosure * @param RenderingContextInterface $renderingContext * @return int|null */ public static function renderStatic( array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext ) { $rootId = \Opentalent\OtTemplating\ViewHelpers\RootPage\GetIdViewHelper::renderStatic( $arguments, $renderChildrenClosure, $renderingContext ); $pageRepository = new OtPageRepository(); $subpages = $pageRepository->getAllSubpagesForPage($rootId); foreach ($subpages as $page) { if ($page['slug'] === $arguments['slug']) { return $page['uid']; } } return null; } }