You are here

public static function SchemaMetatagManager::renderArrayJsonLd in Schema.org Metatag 7

Create the JSON LD render array.

Parameters

string $jsonld: The JSONLD string value.

Return value

array A render array for the JSONLD, .

Overrides SchemaMetatagManagerInterface::renderArrayJsonLd

2 calls to SchemaMetatagManager::renderArrayJsonLd()
SchemaMetatagManager::getRenderedJsonld in src/SchemaMetatagManager.php
Render JSON LD for a specific entity.
schema_metatag_html_head_alter in ./schema_metatag.module
Implements hook_html_head_alter().

File

src/SchemaMetatagManager.php, line 86
A generic substitution for Drupal 8 Random utility.

Class

SchemaMetatagManager
Class SchemaMetatagManager.

Code

public static function renderArrayJsonLd($jsonld) {
  return [
    '#type' => 'html_tag',
    '#tag' => 'script',
    '#value' => $jsonld,
    '#attributes' => [
      'type' => 'application/ld+json',
    ],
  ];
}