2017 © Pedro Peláez
 

silverstripe-vendormodule youtubefield

Field for selecting YouTube videos. Takes various URL formats as input and stores the YouTube ID.

image

edgarindustries/youtubefield

Field for selecting YouTube videos. Takes various URL formats as input and stores the YouTube ID.

  • Friday, July 20, 2018
  • by edlinklater
  • Repository
  • 6 Watchers
  • 14 Stars
  • 1,863 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 7 Forks
  • 3 Open issues
  • 10 Versions
  • 76 % Grown

The README.md

ABANDONED! Use the fork toastnz/youtubefield., (*1)

YouTube Field for SilverStripe

Introduction

This SilverStripe module provides a YouTube field for use in the CMS/ModelAdmin. It accepts input of various common YouTube URL formats and converts them for storage in database as the 11-character YouTube ID., (*2)

Once a valid ID is saved the field will display the video's thumbnail and title., (*3)

Optionally you can provide a key for the YouTube v3 API, which is used to display additional information (duration and view count) and provides information immediately (rather than after saving)., (*4)

Screenshot of Video Information, (*5)

Requirements

  • silverstripe/framework ^4.0 (See 1 branch for SilverStripe 3 compatibility)

Basic field

mysite/code/Page.php, (*6)

<?php

use EdgarIndustries\YouTubeField\YouTubeField;

class Page extends SiteTree
{

    private static $db = array(
        'VideoID' => 'Varchar(11)',
    );

    public function getCMSFields() {
        $fields = parent::getCMSFields();
        $fields->addFieldToTab('Root.Main', new YouTubeField('VideoID', 'YouTube Video'));
        return $fields;
    }

}

mysite/_config/config.yml, (*7)

EdgarIndustries\YouTubeField\YouTubeField:
  api_key: YOUR_API_KEY

URL Parser

There is a static function which can be called (without using the YouTubeField) to simply retrieve the YouTube ID from a supported URL format., (*8)

YouTubeField::url_parser($url);

The Versions

20/07 2018

dev-master

9999999-dev

Field for selecting YouTube videos. Takes various URL formats as input and stores the YouTube ID.

  Sources   Download

BSD-3-Clause

The Requires

 

silverstripe youtube formfield

20/11 2017

dev-ss4-upgrade

dev-ss4-upgrade

Field for selecting YouTube videos. Takes various URL formats as input and stores the YouTube ID.

  Sources   Download

BSD-3-Clause

The Requires

 

silverstripe youtube formfield

20/11 2017

1.1

1.1.0.0

Field for selecting YouTube videos. Takes various URL formats as input and stores the YouTube ID.

  Sources   Download

BSD-3-Clause

The Requires

 

silverstripe youtube formfield

20/11 2017

2.0-beta1

2.0.0.0-beta1

Field for selecting YouTube videos. Takes various URL formats as input and stores the YouTube ID.

  Sources   Download

BSD-3-Clause

The Requires

 

silverstripe youtube formfield

20/11 2017

1.x-dev

1.9999999.9999999.9999999-dev

Field for selecting YouTube videos. Takes various URL formats as input and stores the YouTube ID.

  Sources   Download

BSD-3-Clause

The Requires

 

silverstripe youtube formfield

30/10 2017

1.0

1.0.0.0

Field for selecting YouTube videos. Takes various URL formats as input and stores the YouTube ID.

  Sources   Download

BSD-3-Clause

The Requires

 

silverstripe youtube formfield

18/01 2017

0.2

0.2.0.0

Field for selecting YouTube videos. Takes various URL formats as input and stores the YouTube ID.

  Sources   Download

BSD-3-Clause

The Requires

 

silverstripe youtube formfield

09/09 2015

0.1.2

0.1.2.0

Field for selecting YouTube videos. Takes various URL formats as input and stores the YouTube ID.

  Sources   Download

BSD-3-Clause

The Requires

 

silverstripe youtube formfield

08/09 2015

0.1.1

0.1.1.0

Field for selecting YouTube videos. Takes various URL formats as input and stores the YouTube ID.

  Sources   Download

BSD-3-Clause

The Requires

 

silverstripe youtube formfield

23/07 2015

0.1

0.1.0.0

Field for selecting YouTube videos. Takes various URL formats as input and stores the YouTube ID.

  Sources   Download

BSD-3-Clause

The Requires

 

silverstripe youtube formfield