netwerkstatt / silverstripe-opengraph-extension
Extends tractorcow/silverstripe-opengraph with better image handling (FocusPoint), Twitter cards, and Schema.org support.
Package info
github.com/wernerkrauss/silverstripe-opengraph-extension
Type:silverstripe-vendor-module
pkg:composer/netwerkstatt/silverstripe-opengraph-extension
0.1
2026-03-10 22:52 UTC
Requires
- php: ^8.1
- netwerkstatt/silverstripe-image-toolkit: ^1
- silverstripe/framework: ^5 || ^6
- tractorcow/silverstripe-opengraph: ^6
Suggests
- jonom/silverstripe-focuspoint: Allows better image cropping for social media
- spatie/schema-org: Fluent API for Schema.org JSON-LD
README
Extends tractorcow/silverstripe-opengraph with advanced image handling and Schema.org support.
Features
- Advanced Image Handling: Automatically resizes images to 1200x630px.
- FocusPoint Support: Uses
FocusFill()ifjonom/silverstripe-focuspointis installed. - Watermark Support: Automatically applies watermarks if the image has a
Watermarked()method. - Twitter Cards: Automatically generates
twitter:card(summary_large_image). - OG Dimensions: Includes
og:image:widthandog:image:heightfor faster preview generation. - Schema.org (JSON-LD): Provides a generic framework for JSON-LD, with optional
spatie/schema-orgsupport.
Installation
With composer:
composer require netwerkstatt/silverstripe-opengraph-extension
Configuration
The module is pre-configured to apply to all Page objects. You can customise the image dimensions in YAML:
Netwerkstatt\OpenGraph\Extension\OpenGraphImageExtension: og_image_width: 1200 og_image_height: 630
Schema.org Customization
You can extend the JSON-LD data in your Page class or via an extension:
public function updateSchemaData(&$schema) { // If spatie/schema-org is used, $schema is a Spatie object if ($schema instanceof \Spatie\SchemaOrg\WebPage) { $schema->author('My Name'); } }