PHPackages                             nathancox/embedfield - 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. [Image &amp; Media](/categories/media)
4. /
5. nathancox/embedfield

ActiveSilverstripe-vendormodule[Image &amp; Media](/categories/media)

nathancox/embedfield
====================

A form field for adding oembed objects (primarily videos) to pages or dataobjects

3.0.0(2y ago)524.0k↑150%9[3 issues](https://github.com/davejtoews/silverstripe-embedfield/issues)BSD-3-ClausePHPCI failing

Since Nov 24Pushed 2y ago3 watchersCompare

[ Source](https://github.com/davejtoews/silverstripe-embedfield)[ Packagist](https://packagist.org/packages/nathancox/embedfield)[ Docs](https://github.com/nathancox/silverstripe-embedfield)[ RSS](/packages/nathancox-embedfield/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (2)Versions (6)Used By (0)

SilverStripe EmbedField
=======================

[](#silverstripe-embedfield)

This field is designed to let users attached an oembed object (eg a YouTube video) to a page or dataobject. It stores the oembed result information in an EmbedObject for easy access from the template (or wherever you want it).

Work in progress.

Requirements
------------

[](#requirements)

- SilverStripe 4.11+ or 5.x

Documentation
-------------

[](#documentation)

[GitHub](https://github.com/nathancox/silverstripe-embedfield/wiki)

Installation Instructions
-------------------------

[](#installation-instructions)

1. Install with composer `composer require nathancox/embedfield`
2. Visit yoursite.com/dev/build to rebuild the database

Usage Overview
--------------

[](#usage-overview)

Make a has\_one relationship to an EmbedObject then create an EmbedField in getCMSFields:

```
namespace {

    use SilverStripe\CMS\Model\SiteTree;
    use nathancox\EmbedField\Model\EmbedObject;
    use nathancox\EmbedField\Forms\EmbedField;

    class Page extends SiteTree
    {
        private static $db = [];

        private static $has_one = [
            'MyVideo' => EmbedObject::class
        ];

        public function getCMSFields() {
            $fields = parent::getCMSFields();

            $fields->addFieldToTab('Root.Main', EmbedField::create('MyVideoID', 'Sidebar video'));

            return $fields;
        }
    }
}
```

Gives us:

[![example embedfield](https://camo.githubusercontent.com/a1ac00dae053bb8c2c4fb6fc89a194ab08bd5bdbd88c139baf5ded0c15a8f153/68747470733a2f2f692e6962622e636f2f48787a375647422f656d6265646669656c642e6a7067)](https://camo.githubusercontent.com/a1ac00dae053bb8c2c4fb6fc89a194ab08bd5bdbd88c139baf5ded0c15a8f153/68747470733a2f2f692e6962622e636f2f48787a375647422f656d6265646669656c642e6a7067)

In the page template the video can now be embedded with `$MyVideo`.

Each embed type is rendered with it's own template (eg EmbedObject\_video.ss and EmbedObject\_photo.ss). The default templates just return the markup generated by SilverStripe's OembedResult::forTemplate(). You can override them in your theme:

themes/mytheme/templates/nathancox/EmbedField/Model/EmbedObject\_video.ss:

```

		$EmbedHTML

```

This can be combined with your own CSS to make aspect ratio aware flexible video (see ).

Known Issues
------------

[](#known-issues)

[Issue Tracker](https://github.com/nathancox/silverstripe-embedfield/issues)

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance8

Infrequent updates — may be unmaintained

Popularity34

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 52.9% 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 ~891 days

Total

4

Last Release

787d ago

Major Versions

1.0.1 → 2.0.02019-02-04

2.0.0 → 3.0.02024-03-22

### Community

Maintainers

![](https://www.gravatar.com/avatar/7180a8cd979165ae26632d1b0145cd4f720c5a4946692231009995b103897a2b?d=identicon)[nathancox](/maintainers/nathancox)

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

---

Top Contributors

[![DoggersHusky](https://avatars.githubusercontent.com/u/8750719?v=4)](https://github.com/DoggersHusky "DoggersHusky (18 commits)")[![nathancox](https://avatars.githubusercontent.com/u/194315?v=4)](https://github.com/nathancox "nathancox (9 commits)")[![davejtoews](https://avatars.githubusercontent.com/u/9664035?v=4)](https://github.com/davejtoews "davejtoews (5 commits)")[![ChrissiQ](https://avatars.githubusercontent.com/u/1127719?v=4)](https://github.com/ChrissiQ "ChrissiQ (1 commits)")[![rsmclaren](https://avatars.githubusercontent.com/u/1579625?v=4)](https://github.com/rsmclaren "rsmclaren (1 commits)")

---

Tags

silverstripevideocmsformfieldoembed

### Embed Badge

![Health badge](/badges/nathancox-embedfield/health.svg)

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

PHPackages © 2026

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