This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

Redxlll3
Redxlll3

Feature
YouTube / Video embed in Octobers' Rich Editor.

More Info
The new Media Manager is great in conjunction with the Rich Editor, but I still can't find a way to embed a YouTube video without getting into the HTML side of things. Froala editor and CKEditor both come with the feature to simply click a button and then paste in the embed code, or the YouTube link (Froala).

Thanks
If I've missed something or anyone has suggestions, I'm all for it.

Cheers

Last updated

Krisawzm
Krisawzm

This isn't really a solution to your request, however, if you're using the Static Pages plugin, you could create a snippet to do this. If you haven't checked out the plugin yet, I highly recommend doing so.

Step one: Create a snippet for embedding a YouTube video.

Step two: Insert a YouTube embed snippet by clicking "Snippets" in the menu, then clicking on the snippet. This will add a snippet box into the content editor. This box can easily be rearranged in the content as you wish. Click on the box to change the video ID.

The only real downside to this approach is it only works within the Pages plugin. Meaning it won't work with, say, creating an e-mail template using the rich text editor.

--

Since snippets are basically partials, you can even implement logic by adding your own PHP code. This makes snippets very flexible.

For instance, you could "parse" the ID parameter, allowing the user to input either a full YouTube URL rather than the actual video ID. Although, I'm not sure how you would go about fetching a property in the code. (didn't find any information in the documentation)

It's also possible to register plugin snippets as components using registerPageSnippets() in the plugin registration file.

--

Links:

Static Pages - the Static Pages plugin

Introducing Snippets - Blog post on snippets

Last updated

Redxlll3
Redxlll3

Thanks for the reply Krisawzm! Great solution to the problem I had, I've been using Static Pages so have implimented this and it works great, definitely something I'll be using. I hope in some update of the default Rich Text Editor that there'll be something like this built in, but for now, I've got this set up and will do the same for any other embeds.

Cheers

Hybrid
Hybrid

I was searching for this too and I found Krisawzm's plugin: https://octobercms.com/plugin/krisawzm-embed - looks like a really good solution with some nice extra URL parsing functionality. I'll be trying it out, thanks Krisawzm :)

1-4 of 4

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.