PHPackages                             bramdeleeuw/silverstripe-schema - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. bramdeleeuw/silverstripe-schema

ActiveSilverstripe-vendormodule[Utility &amp; Helpers](/categories/utility)

bramdeleeuw/silverstripe-schema
===============================

Add schema to a Silverstripe page

3.0.2(2y ago)109.1k↓100%6[1 PRs](https://github.com/TheBnl/silverstripe-schema/pulls)2BSD-3-ClausePHP

Since Dec 12Pushed 7mo ago2 watchersCompare

[ Source](https://github.com/TheBnl/silverstripe-schema)[ Packagist](https://packagist.org/packages/bramdeleeuw/silverstripe-schema)[ RSS](/packages/bramdeleeuw-silverstripe-schema/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (1)Dependencies (1)Versions (16)Used By (2)

Silverstripe Schema
===================

[](#silverstripe-schema)

Add schema's to you pages. This module comes with the following standard schema's

- Website schema
- Breadcrumbs schema
- Organization schema
- Local Business Schema
- News Article Schema

To find out more about these schema's and why you should include them on your page see the [documentation](https://developers.google.com/search/docs/data-types/data-type-selector) by Google.

The end goal is to have a module that adds the necessary tools to easily make your own schema's. This is possible by extending the base `SchemaBuilder` class.

Creating new Schema's
---------------------

[](#creating-new-schemas)

An example schema builder, that returns a basic array with properties.

```
/**
 * Class MySchemaBuilder
 */
class MySchemaBuilder extends SchemaBuilder
{
    public function getSchema($page)
    {
        $mySchema = array(
            // schema properties
        )
        return $mySchema;
    }
}
```

The output of the `get_schema()` method is json encoded and appended to the head of the page. The output can either be an array or an object. For the standard builders, the module supplies different `SchemaTypes` where schema's can be build with as an alternative to an array. You can inspect one of the predefined builder to see these types in action. A complete list of possible schema types to work with would be one of the future features. Submitting a pull request with any Schema types or builders you created would be much appreciated!

Adding Schema's
---------------

[](#adding-schemas)

To add the schema's to different page types you simply specify these in the config as such:

```
Page:
  default_image: 'path/to/logo.png'
  extensions:
    - 'Broarm\Schema\SchemaExtension'
  active_schema:
    - 'Broarm\Schema\Builder\LocalBusiness'
    - 'Broarm\Schema\Builder\Website'
    - 'Broarm\Schema\Builder\Breadcrumbs'
BlogPost:
  active_schema:
    - 'Broarm\Schema\Builder\NewsArticle'
```

### LocalBusinessSchemaBuilder

[](#localbusinessschemabuilder)

The local business schema builder searches for the following fields on the SiteConfig. `Address`, `Suburb`, `State`, `Postcode`, `Country` and `Phone` these can be easily added by the `silverstripe-australia/addressable` module. The local business builder also checks if the `Geocodable` extension is set and if so adds the lat and lng to the build schema.

### BreadcrumbsSchemaBuilder

[](#breadcrumbsschemabuilder)

The breadcrumb schema builder looks for the standard `getBreadcrumbItems()` method. You can overwrite this method on your page class if neccicary.

### OrganizationSchemaBuilder

[](#organizationschemabuilder)

The organization builder requires a `phone` field on the site config. For the `SameAs` field (Shows social media link in the knowledge graph box) the builder now looks for `SocialMediaPlatform` relations on SiteConfig. This is something that will be changed for a more generic approach

### WebsiteSchemaBuilder

[](#websiteschemabuilder)

The website schema builder set the site name and url and if FulltextSearchable is enabled it also adds an Search Action. The search action is visible in google as a [Sitelinks Searchbox](https://developers.google.com/search/docs/data-types/sitelinks-searchbox).

ToDo
----

[](#todo)

The following Schema's are to be added in the near future, feel free to make a PR or any suggestions.

- Events
- Products
- Courses
- Music
- Recipes
- Reviews
- Movies
- TVSeason
- TVEpisode
- Videos

###  Health Score

44

—

FairBetter than 92% of packages

Maintenance44

Moderate activity, may be stable

Popularity31

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity71

Established project with proven stability

 Bus Factor1

Top contributor holds 80% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~203 days

Recently: every ~369 days

Total

14

Last Release

797d ago

Major Versions

0.1.0 → 1.0.02017-01-03

1.1.1 → 2.0.02017-11-22

1.1.2 → 2.0.42020-02-19

2.0.5 → 3.0.02024-02-26

### Community

Maintainers

![](https://www.gravatar.com/avatar/6131c03b7f5ba6b10fef192c90d68d57508e84c007a13321df6960b8298e19d1?d=identicon)[TheBnl](/maintainers/TheBnl)

---

Top Contributors

[![TheBnl](https://avatars.githubusercontent.com/u/1334195?v=4)](https://github.com/TheBnl "TheBnl (28 commits)")[![MikeZonnevijlle](https://avatars.githubusercontent.com/u/16706383?v=4)](https://github.com/MikeZonnevijlle "MikeZonnevijlle (4 commits)")[![RVXD](https://avatars.githubusercontent.com/u/1586761?v=4)](https://github.com/RVXD "RVXD (2 commits)")[![sunnysideup](https://avatars.githubusercontent.com/u/167154?v=4)](https://github.com/sunnysideup "sunnysideup (1 commits)")

---

Tags

schemasilverstripestructured-dataschema.orgknowledge-graph

### Embed Badge

![Health badge](/badges/bramdeleeuw-silverstripe-schema/health.svg)

```
[![Health](https://phpackages.com/badges/bramdeleeuw-silverstripe-schema/health.svg)](https://phpackages.com/packages/bramdeleeuw-silverstripe-schema)
```

###  Alternatives

[torann/json-ld

Extremely simple JSON-LD markup generator.

149620.7k1](/packages/torann-json-ld)[brick/schema

Schema.org library for PHP

5163.7k1](/packages/brick-schema)[brotkrueml/schema

Embedding schema.org vocabulary - API and view helpers for schema.org markup

33584.6k13](/packages/brotkrueml-schema)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
