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 ) { if (TYPO3_MODE == 'FE') { $pageUid = (int) $GLOBALS['TSFE']->id; } else { $pageUid = (int) GeneralUtility::_GP('id'); } $pageRepository = GeneralUtility::makeInstance(OtPageRepository::class); $preferences = $pageRepository->getTemplatePreferences($pageUid); $key = $arguments['key']; return $preferences[$key]; } }