Download the PHP package richardsjoqvist/silverstripe-embedder without Composer

On this page you can find all versions of the php package richardsjoqvist/silverstripe-embedder. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package silverstripe-embedder

Embedder SilverStripe module

Embedder enables embedding in content fields area similar to how embeds work in WordPress, and can embed media from pasted links and HTML code.

Requirements

Installation

Drop the module into your SilverStripe project and run /dev/build

Usage

The idea is to convert URLS for media ( Youtube, Vimeo) in the markup into embbedded media. For example the following text

<p> Best Video ever !</p>
<p>https://www.youtube.com/watch?v=9bZkp7q19f0</p>

would be converted into

<p> Best Video ever !</p>
<p><div class="fluid-width-video-wrapper" style="padding-top: 56.2667%;"><iframe src="https://www.youtube.com/embed/9bZkp7q19f0?feature=oembed" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen="" name="fitvid2"></iframe></div></p>

Enable Embedder on content fields

Embedder must be activated in your project _config.php. This is done by registering which fields on which pagetypes Embedder should work. The following example would enable Embedder on the "Content" field on pages of the "Page" type:

RichardsJoqvist\silverstripeEmbedder\Embedder:
  fields:
    Page:
      - Content

The following example would enable Embedder on the "Intro" field on all page types:

RichardsJoqvist\silverstripeEmbedder\Embedder:
  fields:
    all
      - Intro;

Specify embedded media size

Add the following to set the width of media embedded from links:

RichardsJoqvist\silverstripeEmbedder\Embedder:
  width: 750
  maxWidth: 750

The following methods are included to control embed size:

Sizes will be calculated with aspect ratio maintained.

Register media providers

Several pre-packaged providers (content sites) are included. They must be separately registered as such:

RichardsJoqvist\silverstripeEmbedder\Embedder:
  providers:
    - \RichardsJoqvist\silverstripeEmbedder\Youtube
    - \RichardsJoqvist\silverstripeEmbedder\Vimeo
    - \RichardsJoqvist\silverstripeEmbedder\Instagram

The following providers are included:

You can easily add more custom providers that conform to the oEmbed specification. Simply copy one of the included provider classes to your project directory and modify it to suit your needs, then run /dev/build to register the provider class with SilverStripe and enable it in your _config.php. See the oEmbed website for more information.

Register HTML tags

Embedder can also render pasted HTML code based on tag names:

RichardsJoqvist\silverstripeEmbedder\Embedder:
  tags:
    - object
    - iframe
    - embed

This registers <object>, <iframe> and <embed>-tags to be rendered as objects instead of HTML entities. For example, if the following code is pasted in an Embedder-enabled field it will be rendered as an iframe:

<iframe width="640" height="390"
src="http://www.youtube.com/embed/dQw4w9WgXcQ"
frameborder="0" allowfullscreen></iframe>

Full config Example

This file would be called embedder.yml

RichardsJoqvist\silverstripeEmbedder\Embedder:
width: 750
maxWidth: 750
fields:
  SilverStripe\Blog\Model\BlogPost:
    - Content
  Page:
    - Content
  AnotherPageType:
    - Content
    - Another HTML Field
providers:
  - \RichardsJoqvist\silverstripeEmbedder\Youtube
  - \RichardsJoqvist\silverstripeEmbedder\Vimeo
  - \RichardsJoqvist\silverstripeEmbedder\Instagram

All versions of silverstripe-embedder with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.2
composer/installers Version *
silverstripe/framework Version ~3.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package richardsjoqvist/silverstripe-embedder contains the following files

Loading the files please wait ....