registerArgument( 'key', 'string', 'The name of the requested preference', true ); } /** * -- This method is expected by Fluid -- * Renders the content as html * * @param array $arguments * @param Closure $renderChildrenClosure * @param RenderingContextInterface $renderingContext * @return array */ public static function renderStatic( array $arguments, Closure $renderChildrenClosure, RenderingContextInterface $renderingContext ) { $pageRepository = GeneralUtility::makeInstance(ObjectManager::class)->get(OtPageRepository::class); $rootUid = $pageRepository->getCurrentSiteRootPageId(); $templateRepository = GeneralUtility::makeInstance(ObjectManager::class)->get(TemplateRepository::class); $preferences = $templateRepository->getTemplatePreferences($rootUid); $key = $arguments['key']; return $preferences[$key]; } }