ProcessWire Fieldtype for collecting and store oembed data

Overview

FieldtypeOembed

What it does

Store, collect and update oembed data from external sources. It used the great PHP Library Essence by Félix Girault and adds some processwire magic. This field is based on the example module FieldtypeEvents by Ryan and the TextformatterOEmbed by felixwahner. Thanks!

Features

  • Simple embedding of content via oembed endpoints and opengraph crawling
  • Backend preview
  • Searching in oembed data with $pages->find()
  • Autoupdate with lazycron
  • Support for ProcessGraphQL with the additional module GraphQLFieldtypeOembed

Install

  1. Copy the files for this module to /site/modules/FieldtypeOembed/
  2. Execute the following command in the /site/modules/FieldtypeOembed/ directory.
    composer install
  3. In admin: Modules > Refresh. Install Fieldtype > Oembed.
  4. Create a new field of type Oembed, and name it whatever you would like. In our examples we named it simply "embed".
  5. Add the field to a template and edit a page using that template.

Configuration

Modules > Configure > FieldtypeOembed

Lazycron

Setup the Lazycron schedule. The cache expiration is configurable in the field settings.

Lazycron

Custom Provider for Essence

You can configure your own Oembed or OpenGraph providers for Essence.
How to add custom providers (Essence Git)

{
	"getty": {
		"class": "OEmbed",
		"filter": "~gty\\.im/.+~i",
		"endpoint": "http://embed.gettyimages.com/oembed?url=:url"
	},
	"neuerituale": {
		"class": "OpenGraph",
		"filter": "~neuerituale\\.com.?~i"
	}
}

Field settings

Fields > embed > Details The FieldtypeOembed extends the FieldtypeURL (core). In addition to these settings, you can also set the cache time for the oembed data. The lazycron will update the data.

Fieldsettings

Field preview

Fieldpreview

API

Returns the Oembed object (WireData).

/** @var \ProcessWire\Oembed */
$page->embed

Check emptiness

/** @var boolean **/
$page->embed->empty

Render

/** @var string return the html from oembed result */
"$page->embed"
$page->embed->html

The Oembed object

// print_r($page->embed);

ProcessWire\Oembed Object
(
    [data] => Array
        (
            [empty] => false
            [url] => http://www.youtube.com/watch?v=dQw4w9WgXcQ
            [html] => '...'
            [type] => video
            [title] => Rick Astley - Never Gonna Give You Up (Video)
            [width] => 200
            [height] => 113
            [version] => 1.0
            [authorUrl] => https://www.youtube.com/user/RickAstleyVEVO
            [authorName] => RickAstleyVEVO
            [providerUrl] => https://www.youtube.com/
            [providerName] => YouTube
            [thumbnailUrl] => https://i.ytimg.com/vi/dQw4w9WgXcQ/hqdefault.jpg
            [thumbnailWidth] => 480
            [thumbnailHeight] => 360
        )
)

Find pages

You can query the oembed result fields

$pages->find('embed.providerName=YouTube');
$pages->find('embed.width>=200');

GraphQLFieldtypeOembed

You can query this field over ProcessGraphQL.
Please install the additional module GraphQLFieldtypeOembed.

Field definitions

myfield {
   empty: Boolean
   title: String
   authorName: String
   authorUrl: String
   type: String
   height: Int
   width: Int
   providerName: String
   providerUrl: String
   thumbnailHeight: Int
   thumbnailWidth: Int
   thumbnailUrl: String
   html: String
   url: String
}
You might also like...
Laravel package to work with geospatial data types and functions.

Laravel Spatial Laravel package to work with geospatial data types and functions. For now it supports only MySql Spatial Data Types and Functions. Sup

LaravelFly is a safe solution to speeds up new or old Laravel 5.5+ projects, with preloading and coroutine, while without data pollution or memory leak

Would you like php 7.4 Preloading? Would you like php coroutine? Today you can use them with Laravel because of Swoole. With LaravalFly, Laravel will

Login system designed by fragX to validate the user and prevent unauthorized access to confidential data.

Login_System v.0.1 Login system designed by fragX to validate the user and prevent unauthorized access to confidential data. 🧐 Features Sign In and S

Data Table package with server-side processing, unlimited exporting and VueJS components
Data Table package with server-side processing, unlimited exporting and VueJS components

Data Table package with server-side processing, unlimited exporting and VueJS components. Quickly build any complex table based on a JSON template.

The query filter bundle allows you to filter data from QueryBuilder and the Database.
The query filter bundle allows you to filter data from QueryBuilder and the Database.

The query filter bundle allows you to filter data from QueryBuilder and the Database. you can filter multiple columns at the same time and also you can filter relation fields with two-level deep and without any join in your query builder.

Validate your input data in a simple way, an easy way and right way. no framework required. For simple or large. project.

wepesi_validation this module will help to do your own input validation from http request POST or GET. INTEGRATION The integration is the simple thing

A PHP package that provides common Data and Value Objects, that are Laravel castable.

Common Casts A PHP package that provides common Data and Value Objects, that are Laravel castable. Installation composer require juststeveking/common-

Run multiple websites using the same Laravel installation while keeping tenant specific data separated for fully independent multi-domain setups, previously github.com/hyn/multi-tenant

The unobtrusive Laravel package that makes your app multi tenant. Serving multiple websites, each with one or more hostnames from the same codebase. B

Laravel: Data to Monthly Converter

Laravel: Data to Monthly Converter Using this package you will be able to converts your collection using a timestamp field to order data monthly or ye

Comments
  • Field not working when in a repeater

    Field not working when in a repeater

    Hi,

    First of all thank you for your module.

    I'm having an issue where I have my field in a repeater matrix but it prints out the error "No oembed data or provider found.". However the same link in a field not being in a repeater works without any issues.

    I wonder if being in a repeater gives it a special context and somehow avoids your module from working properly ?

    Let me know if you need more informations.

    opened by romaincazier 3
Releases(1.1.4)
Owner
Neue Rituale
Studio für Formgestaltung und Technik
Neue Rituale
Store and retrieve settings generally or for model objects in Laravel.

Store and retrieve settings generally or for model objects in Laravel. Documentation You can find the detailed documentation here in Laravel Settings

Pharaonic 7 Dec 19, 2022
Laravel application project as Sheina Online Store backend to be built with Laravel and VueJS

About Laravel Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experie

Boas Aditya Christian 1 Jan 11, 2022
A Simple Store Front Web Application using Laravel and Bootstrap.

About Laravel Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experie

Basil Basaif 1 Nov 28, 2021
If you are beginner in WordPress plugin development or if you want to develop your own store product plugin you use this plugin

hirwa-products-plugin If you are beginner in WordPress plugin development or if you want to develop your own store product plugin you use this plugin

NIYIBIZI HIRWA 1 Aug 23, 2022
Store your Laravel application settings in an on-disk JSON file

Store your Laravel application settings in an on-disk JSON file. This package provides a simple SettingsRepository class that can be used to store you

Ryan Chandler 24 Nov 16, 2022
Smeify is a Stable Automated Solution for Airtime and Data businesses in Nigeria, this package helps you integrate smeify easily into your laravel application.

Smeify is a Stable Automated Solution for Airtime and Data businesses in Nigeria, this package helps you integrate smeify easily into your laravel application.

Ogundiran Adewale Charles 2 Jul 27, 2022
Postier is a Laravel API automation platform to transfer data and to sync apps.

Postier is a Laravel API automation platform to transfer data and to sync apps. You can build workflows with data and actions of multiple apps and apply logics to the data!

null 55 Oct 28, 2022
Intranet Home Page is a highly-configurable self-hosted browser homepage with integrations for public and local data feeds.

Intranet-Home-Page Created in response to personal "dashboards" that are little more than pages with a list of frequently accessed links, Intranet Hom

null 56 Aug 27, 2022
Flow package to synchronize metadata and binary data of imported Neos.Media assets

Wwwision.AssetSync Flow package to synchronize metadata and resources of imported Neos.Media assets Installation Install this package via: composer re

Bastian Waidelich 5 Feb 7, 2022
An easy way to get vendor and package data from Packagist via API calls

Laravel Packagist Laravel Packagist (LaravelPackagist) is a package for Laravel 5 to interact with the packagist api quickly and easily. Table of cont

Jeremy Kenedy 5 Jul 18, 2022