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 2d 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 79% 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

3885d 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

[helsingborg-stad/municipio

A bootstrap theme for creating municipality sites.

4028.5k10](/packages/helsingborg-stad-municipio)[mautic/core

Mautic Open Source Distribution

10.0k2.6k9](/packages/mautic-core)[mediawiki/maps

Adds various mapping features to MediaWiki

84152.3k3](/packages/mediawiki-maps)[starcitizentools/citizen-skin

A beautiful, usable, responsive MediaWiki skin with in-depth extension support. Originally developed for the Star Citizen Wiki.

3376.6k](/packages/starcitizentools-citizen-skin)[civicrm/civicrm-drupal-8

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

19251.4k3](/packages/civicrm-civicrm-drupal-8)[altis/core

Core module for Altis

19228.0k3](/packages/altis-core)

PHPackages © 2026

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