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

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

sunnysideup/dataobjectpreview
=============================

Allows preview of dataobjects in GridField

3.0.1(2y ago)0241MITPHP

Since Jul 17Pushed 2y agoCompare

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

READMEChangelogDependencies (1)Versions (14)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

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity70

Established project with proven stability

 Bus Factor1

Top contributor holds 84.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 ~516 days

Recently: every ~949 days

Total

10

Last Release

38d ago

Major Versions

1.0.5 → 3.x-dev2019-10-03

2.0.0 → 3.0.12023-07-25

3.0.1 → 5.x-dev2026-04-06

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/167154?v=4)[Sunny Side Up](/maintainers/sunnysideup)[@sunnysideup](https://github.com/sunnysideup)

---

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)")[![sunnysideup](https://avatars.githubusercontent.com/u/167154?v=4)](https://github.com/sunnysideup "sunnysideup (2 commits)")[![lucasfrey](https://avatars.githubusercontent.com/u/7697132?v=4)](https://github.com/lucasfrey "lucasfrey (1 commits)")

### Embed Badge

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

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

PHPackages © 2026

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