TextformatterOEmbed by felixwahner

At this point this module basically wraps the fabolous Essence PHP library by Félix Girault and adds some processwire magic to parse your boring Textareas and make your content look more bling bling than ever before.

So you've developed this shiny new website but your editors and marketing guys keep complaining they need more "native embedded content" with shiny share and retweet buttons because otherwise their text will look like ...text?
Look no further: This processwire module has you covered!

#TextformatterOEmbed for processwire


What it does

At this point this module basically wraps the fabolous Essence PHP library by Félix Girault and adds some processwire magic to parse your boring Textareas and make your content look more bling bling than ever before.
Disclaimer: This Module is heavily inspired by TextFormatterVideoEmbed by the awesome guy who created processwire: RyanCramer.

Requirements

  • php 5.4+
  • curl and/or allow_fopen on

Features

  • Supports the following 32 providers out of the box
23hq             Dipity          Official.fm     Ted
Bandcamp         Flickr          Polldaddy       Twitter
Blip.tv          FunnyOrDie      Prezi           Vhx
Cacoo            HowCast         Qik             Viddler
CanalPlus        Huffduffer      Revision3       Vimeo
Chirb.it         Hulu            Scribd          Yfrog
Clikthrough      Ifixit          Shoudio         Youtube
CollegeHumor     Imgur           Sketchfab
Dailymotion      Instagram       SlideShare
Deviantart       Mobypicture     SoundCloud

(That's a lot of Hanna-Codes you can get rid of now, eh?):

  • Add your own providers in the blink of an eye (if you're not good at regex - like me - it will propably take you a cup of coffee and a google search)
  • Easy styling: Wraps embedded items with customizable BEM-Style classes including modifiers for every provider and embedtype. Choose to either add CSS directly in the modules configuration or to your existing stylesheets
  • Choose to add pre defined Fluid Video CSS for your responsive design (or - again - feel free to add your own)

Usage

  • Click check for new modules in ProcessWire Admin Modules screen. Click install for the module labeled: "oEmbed for processwire".
  • Install the module
  • Open the modules Settings page
  • Add css classes either within the "Custom CSS" field or in a seperate CSS file. Every provider is wrapped with the following markup:
<div class="pw-oembed pw-oembed--providername pw-oembed--embedtype">
	<div class="pw-oembed__inner pw-oembed__inner--providername pw-oembed--embedtype"></div>
</div>

If you're not happy with the "block" class .pw-oembed you can rename it to something you like better using the modules config. Every embedded media item and it's respective inner wrapper has two modifier classes: One for the provider (i.e. youtube, twitter...) and one for the media type (one of photo, video, link or rich according to the OEmbed specification). This should be enough classes to add some fancy icons, adjust widths per provider or whatever else you like to do.

  • If you're missing a provider don't hesitate to open a pull request (see roadmap first) and I'll do my best to add it as soon as possible. In the meantime you can extend the available providers found in lib/essence/providers.php in the modules settings using the following JSON-Format (remember that you'll have to properly escape the regex):
	[{
		"23hq" : {
			"class" : "OEmbed",
			"filter" : "#23hq\\.com/.+/photo/.+#i",
			"endpoint" :"http://www.23hq.com/23/oembed?format=json&url=%s"
		}
	}]

Roadmap

  • Add moaaar providers:
    • Facebook (currently not providing a "native" oEmbed API)
    • Google Plus (currently not providing a "native" oEmbed API)
    • support for more fancy integration of Instagram posts (currently there are "just" images without fancy sharing stuff that will be embedded)
  • Render only one javascript (i.e. ) when there are multiple items of the same provider
  • Propably make this module more generic and add services as submodules at some point
  • World domination

Bugs, Suggestions, Contact

Feel free to file bugs using the issue tracker

If you've got any questions regarding the module just drop me a line via e-mail, on twitter or contact me in the processwire forums.

License

  • This module is licensed under the MIT License.
  • The included Library "Essence" by Félix Girault is licensed under the FreeBSD License.

Install and use modules at your own risk. Always have a site and database backup before installing new modules.

Twitter updates

  • There’s a new modules directory on the ProcessWire site now up and running. In this post we’ll cover a few details about what’s changed and what’s new—More
    20 November 2020
  • ProcessWire 3.0.168 core updates — More
    26 October 2020
  • This week a 2nd new module for processing Stripe payments has been added to FormBuilder. Unlike our other Stripe Inputfield, this new one supports 3D Secure (SCA) payments. We’ll take a closer look at it in this post, plus a live demo— More
    16 October 2020

Latest news

  • ProcessWire Weekly #342
    In the 342nd issue of ProcessWire Weekly we're going to check out brand new admin theme called Admin Theme Canvas, a new module called MatomoWire, latest ProcessWire core updates, and more. Read on!
    Weekly.pw / 28 November 2020
  • New ProcessWire modules directory
    There’s a new modules directory on the ProcessWire site now up and running. In this post we’ll cover a few details about what’s changed and what’s new.
    Blog / 20 November 2020
  • Subscribe to weekly ProcessWire news

“…building with ProcessWire was a breeze, I really love all the flexibility the system provides. I can’t imagine using any other CMS in the future.” —Thomas Aull