diff --git a/e107_core/templates/header_default.php b/e107_core/templates/header_default.php index ef8efaea7..93a7462c6 100644 --- a/e107_core/templates/header_default.php +++ b/e107_core/templates/header_default.php @@ -190,7 +190,7 @@ unset($e_headers); /** @experimental - subject to change at any time */ if($schema = e107::schema()) { - echo '\n"; + echo $schema; } unset($schema); diff --git a/e107_handlers/e107_class.php b/e107_handlers/e107_class.php index 22d83888c..6f8d7ead3 100644 --- a/e107_handlers/e107_class.php +++ b/e107_handlers/e107_class.php @@ -4559,21 +4559,38 @@ class e107 /** * Getter/Setter for schema. eg. Google structured data etc. * @param string $json - * @return string|bool|null + * @return string|null */ public static function schema($json = null) { + + static $currentSchema = []; + if(empty($json)) { - return self::getRegistry('core/e107/schema', false); + if(empty($currentSchema)) + { + return ''; + } + + $output = ''; + foreach($currentSchema as $schema) + { + if(!empty($schema)) + { + $output .= '\n"; + } + } + + return $output; } - return self::setRegistry('core/e107/schema',$json); + $currentSchema[] = $json; + return self::setRegistry('core/e107/schema', $currentSchema); } - /** * Retrieve error page handler. *