This project is not covered by Drupal’s security advisory policy.

This project extends Drupal's Metatag module to display vocabulary information as JSON LD in the head of web pages.

The Metatag module is used to define and store the values, and to handle token replacements for the values. Metatag module also provides a nice system of overrides, so you can define default values for all content types, override the node defaults for a particular content type, or even override everything else to provide specific values for an individual node.

This module defines metatag groups that map to types, and metatag tags for properties, then steps in before the values are rendered as metatags, pulls the values out of the header created by Metatag, and instead renders them as JSON LD when the page is displayed.

Since the list is huge, and growing, this module only provides a small subset of those values. But it is designed to be extensible. There is an included module, Article Example, that shows how other modules can add more properties to types that are already defined. Several types are included which can be copied to add new types (groups) with any number of their own properties.

The module includes a base group class and several base tag classes that can be extended. Many properties are simple key/value pairs that require nothing more than extending the base class and giving them their own ids. Some are more complex, like Person and Organization, and BreadcrumbList, and they collect multiple values and serialize the results.

The module creates the following object types:

For more information and to test the results:

Using this module, the code in the head of the page might end up looking like this:

<script type="application/ld+json">{
    "@context": "",
    "@graph": [
            "@type": "Article",
            "description": "Curabitur arcu erat, accumsan id imperdiet et, porttitor at sem. Donec sollicitudin molestie malesuada. Donec sollicitudin molestie malesuada. Donec rutrum congue leo eget malesuada. Nulla quis lorem ut libero malesuada feugiat. Vestibulum ac diam sit amet quam vehicula elementum sed sit amet dui.",
            "datePublished": "2009-11-30T13:04:01-0600",
            "dateModified": "2017-05-17T19:02:01-0500",
            "headline": "Curabitur arcu erat]",
            "author": {
                "@type": "Person",
                "name": "Minney Mouse",
                "sameAs": ""
            "publisher": {
                "@type": "Organization",
                "name": "",
                "sameAs": "",
                "logo": {
                    "@type": "ImageObject",
                    "url": "",
                    "width": "600",
                    "height": "60"
            "mainEntityOfPage": {
                "@type": "WebPage",
                "@id": ""
Supporting organizations: Metatag项目的Drush安装命令:复制到剪贴板



8.x-1.0-rc3tar.gz (19.71 KB) | zip (62.95 KB)2017年6月6日发布说明简 | 繁 | 更多


8.x-1.x-devtar.gz (19.71 KB) | zip (62.98 KB)2017年6月2日发布说明简 | 繁 | 更多