registerArgument( 'column', 'string', 'Page row column name', true, ); $this->registerArgument( 'default', 'string', 'Fallback value when all pages have an empty value', true, ); } public function render(): mixed { $column = $this->arguments['column']; $rootLine = $this->getRootLine(); foreach ($rootLine as $pageRow) { if (!array_key_exists($column, $pageRow)) { throw new \OutOfRangeException( 'Column is not part of the rootline: ' . $column, 1758882723 ); } if ($pageRow[$column] !== null && $pageRow[$column] !== '') { return $pageRow[$column]; } } return $this->arguments['default']; } protected function getRootLine(): array { return $this->getFrontendController()->rootLine; } protected function getFrontendController(): TypoScriptFrontendController { return $GLOBALS['TSFE']; } }