This is a short guide on how to setup oEmbed plugin so authors can easily embed YouTube videos. Since there are several ways of setting up WYSIWYG on Drupal 7, it can easily get confusing. This is much eaiser in Drupal 8 since WYSIWYG is part of core. In this guide, we will be using CKEditor for Drupal 7.
We will install several modules and CKEditor plugins to get this working. Due to dependency issues, we will be using specific versions of each component.
Here is a table of requirements:
Download Modules and Plugins
oEmbed’s latest version (1.17) currently only works with CKeditor 4.4. That is why we downloaded CKEditor library 4.4.
The current version of widget plugin (4.5.10) is not compatible with CKEditor 4.4, so we need to download widget version 4.4.8. If you don’t download the widget plugin, you will get an error like this:
Now we need to tell CKEditor about the oEmbed plugin so that is available for us configure for our text format.
Create a custom module and add the following in the .module
Enable this custom module and continue.
Configure text format
Edit “Full HTML” profile at /admin/config/content/ckeditor/edit/Full
Enable “Embed external media via the oEmbed plugin”
Move “oembed” button from “Available buttons” to “Current toolbar”
You should now be able to embed a video:
Also, remember to download the full CKEditor package. Otherwise, you will run
into some issues. We had initially installed the “standard” version and had to
switch to the “full” version. After having done that, we got the error Cannot
read property 'ltr' of undefined in the console. We opened Chrome developer
tools and clicked on “Disable cache (while DevTools is open)” to resolve it.
If you want to do this quickly, put the following in a .make file and run drush make:
BLEN Corp is a small, minority, and veteran-owned information technology firm located in Washington D.C. Since 2004, we have been ahead of the curve in early adaption and implementation of cutting edge technologies including web and mobile development, service-oriented architecture, and other innovative web based solutions. Look at some of our projects.
WeWork Wonder Bread Factory
641 S St. NW
Washington, DC 20001