Your IP : 216.73.216.240
<?php
/*
* @package Tech Fry Library
* @license https://www.gnu.org/licenses/gpl-3.0.en.html
*/
namespace TechFry\Library\View\Sd;
defined('_JEXEC') or die;
use Joomla\CMS\Uri\Uri;
// https://developers.google.com/search/docs/appearance/structured-data/dataset
class SdDataset
{
public static function get_output($data = array())
{
$uri = Uri::getInstance();
$description = $data['description'] ?? $data['introtext'];
$json = array(
"@context" => "https://schema.org",
"@type" => "Dataset",
"name" => $data['title'] ?? $data['name'],
"description" => strip_tags($description),
);
// The summary must be between 50 and 5000 characters long.
$json["isAccessibleForFree"] = isset($data['free']) && !$data['free'] ? false : true;
Sd::display_sd($json);
}
}