Download the PHP package fromholdio/silverstripe-embedfield without Composer
On this page you can find all versions of the php package fromholdio/silverstripe-embedfield. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download fromholdio/silverstripe-embedfield
More information about fromholdio/silverstripe-embedfield
Files in fromholdio/silverstripe-embedfield
Package silverstripe-embedfield
Short Description A form field for adding oembed objects to pages or dataobjects
License BSD-3-Clause
Homepage https://github.com/fromholdio/silverstripe-embedfield
Informations about the package silverstripe-embedfield
SilverStripe Embed Field
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).
This originally built upon the work of SilverStripe Embed Field nathancox/embedfield which had been quiet for several years.
As of v4.1 the field has been converted to a React-driven form field, enabling use inline in Elemental blocks.
Requirements
- SilverStripe 5.0+
Installation Instructions
- Install with composer
composer require fromholdio/silverstripe-embedfield
- Visit yoursite.com/dev/build to rebuild the database
Usage Overview
Make a has_one relationship to an EmbedObject then create an EmbedField in getCMSFields:
In the page template the video can now be embedded with $MyVideo
.
Form field screenshots
- User inputs URL, and can click Preview to retrieve embed meta information (or learn the URL is invalid)
- On save, if valid, embed data is retrieved and saved into an
EmbedObject
, attached to the has_one populating the field - On load, if EmbedObject exists, the embed meta preview is automatically displayed