This package is abandoned and no longer maintained. The author suggests using the rias/craft-schema package instead.

A fluent builder Schema.org types and ld+json generator based on Spatie's schema-org package

1.0.3 2018-01-14 16:42 UTC

This package is auto-updated.

Last update: 2022-02-01 13:11:43 UTC



Latest Version Quality Score StyleCI Total Downloads

Schema plugin for Craft CMS 3.x

A fluent builder of Schema.org types and ld+json generator based on Spatie's schema-org package which makes for a fast and easy way to add structured data to your templates.

Support Open Source. Buy beer.

This plugin is licensed under a MIT license, which means that it's completely free open source software, and you can use it for whatever and however you wish. If you're using it and want to support the development, buy me a beer over at Beerpay!



This plugin requires Craft CMS 3.0.0-RC1 or later and PHP 7.


To install the plugin, install it from the plugin store or follow these instructions.

  1. Open your terminal and go to your Craft project:

     cd /path/to/project
  2. Then tell Composer to load the plugin:

     composer require rias/craft-schema
  3. In the Control Panel, go to Settings → Plugins and click the “Install” button for schema.

Schema Overview

Schema provides a fluent builder for all Schema.org types and their properties. For more information and the available methods, check out spatie/schema-org.

Using Schema

Once Schema is installed, it's accessible through the craft variable in your templates.

For the best experience, set the schema to a variable and typehint it to Spatie's model. In combination with the Symfony plugin for PHPStorm, you get autocompletion for all the Schema's and their properties.

For example:

{# @var schema \Spatie\SchemaOrg\Schema #}
{% set schema = craft.schema %}
{{ schema
      .name("Rias Van der Veken")
            .streetAddress("IJzerenpoortkaai 3")
      ) | raw

Generates the following output:

<script type="application/ld+json">
   "name":"Rias Van der Veken",
         "streetAddress":"IJzerenpoortkaai 3"

Brought to you by Rias