PHPackages                             heyday/silverstripe-dataobjectpreview - 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. heyday/silverstripe-dataobjectpreview

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

heyday/silverstripe-dataobjectpreview
=====================================

Allows preview of dataobjects in GridField

1.0.5(10y ago)94.5k41MITPHP

Since Jul 17Pushed 8y ago25 watchersCompare

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

READMEChangelogDependencies (1)Versions (7)Used By (1)

SilverStripe DataObject Preview
===============================

[](#silverstripe-dataobject-preview)

Provides the ability to preview DataObjects in the CMS.

Installation (with composer)
----------------------------

[](#installation-with-composer)

```
$ composer require heyday/silverstripe-dataobjectpreview

```

### Filesystem permissions

[](#filesystem-permissions)

The `cache/` directory in this module needs to be writable by PHP for DataObject Preview to work. Previews are rendered to file here to avoid repeated rendering of the same content.

When installing via Composer, you may want to add a post-install script in your project's `composer.json` to configure these permissions. For example:

```
{
    // ...

    "scripts": {
        "post-install-cmd": [
            "chmod 777 silverstripe-dataobjectpreview/cache"
        ]
    }
}
```

Example
-------

[](#example)

[![DataObject Preview Example](resources/example.png?raw=true)](resources/example.png?raw=true)

Usage
-----

[](#usage)

DataObjects that you want to preview must implement, `DataObjectPreviewInterface`, which consists of one method `getPreviewHtml`.

This method `getPreviewHtml` must return a string.

`getPreviewHtml`

```
public function getPreviewHtml()
{
	return "Hello";
}
```

### DataObjectPreviewField

[](#dataobjectpreviewfield)

`getCMSFields`

```
$fields->addFieldToTab(
	'Root.Main',
	new DataObjectPreviewField(
		'SomeDataObject',
		$this,
		new DataObjectPreviewer($generator)
	)
);
```

### GridFieldDataObjectPreview

[](#gridfielddataobjectpreview)

`getCMSFields`

```
$fields->addFieldsToTab(
	'Root.Items',
	new GridField(
		'Items',
		'Items',
		$this->Items(),
		$config = GridFieldConfig_RelationEditor::create()
	)
);

$config->addComponent(
	new GridFieldDataObjectPreview(
		new DataObjectPreviewer($generator)
	)
);
```

License
-------

[](#license)

SilverStripe DataObject Preview is licensed under an [MIT license](http://heyday.mit-license.org/)

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community20

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 88.4% 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 ~169 days

Recently: every ~210 days

Total

6

Last Release

3838d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/de4d8d61f202a03e88c3ed30cce3bfedbc6f56a16e3f3b25546c61aadc51bca2?d=identicon)[heyday](/maintainers/heyday)

---

Top Contributors

[![camspiers](https://avatars.githubusercontent.com/u/51294?v=4)](https://github.com/camspiers "camspiers (38 commits)")[![stecman](https://avatars.githubusercontent.com/u/2230769?v=4)](https://github.com/stecman "stecman (4 commits)")[![lucasfrey](https://avatars.githubusercontent.com/u/7697132?v=4)](https://github.com/lucasfrey "lucasfrey (1 commits)")

### Embed Badge

![Health badge](/badges/heyday-silverstripe-dataobjectpreview/health.svg)

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

###  Alternatives

[rainlab/blog-plugin

Blog plugin for October CMS

17257.7k](/packages/rainlab-blog-plugin)[rainlab/builder-plugin

Builder plugin for October CMS

17147.2k1](/packages/rainlab-builder-plugin)[pfefferle/wordpress-activitypub

The ActivityPub protocol is a decentralized social networking protocol based upon the ActivityStreams 2.0 data format.

5671.4k1](/packages/pfefferle-wordpress-activitypub)[civicrm/civicrm-drupal-8

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

18238.1k2](/packages/civicrm-civicrm-drupal-8)[mediawiki/semantic-glossary

A terminology markup extension with a Semantic MediaWiki back-end

1352.4k](/packages/mediawiki-semantic-glossary)[humanmade/lottie-lite

A lightweight Lottie Animations Extension for WordPress

374.3k](/packages/humanmade-lottie-lite)

PHPackages © 2026

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