Can't embed code in post

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
Post Reply
lstench
Regular
Posts: 16
Joined: Mon Nov 19, 2012 1:59 pm

Can't embed code in post

Post by lstench »

Hello I am using the new editor (ckeditor) and I am unable to embed any youtube videos or anything in my html nugget plugin on my sidebar. Is there a way I can fix this problem?
Don Chambers
Regular
Posts: 3652
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Re: Can't embed code in post

Post by Don Chambers »

Please post a url to your site, as well as a link to the code that is not working.
=Don=
lstench
Regular
Posts: 16
Joined: Mon Nov 19, 2012 1:59 pm

Re: Can't embed code in post

Post by lstench »

Here is the info you requsested.

http://lydiastench.com/

This is the link to the actual post.

http://lydiastench.com/archives/37-Maundy-Thursday.html

It is now showing up.It wouldn't display all yesterday. When I went just now it was there. Nothing is showing in the editor though. Attached screenshot.

The link to the video.
http://www.youtube.com/watch?feature=pl ... 6s22GxaCQ0
Attachments
snapshot6.png
snapshot6.png (28.75 KiB) Viewed 6838 times
Don Chambers
Regular
Posts: 3652
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Re: Can't embed code in post

Post by Don Chambers »

Yes, the video works fine. When you add code like that to an entry, it is usually best to add it when in html mode. I have not used ckeditor, but there is probably a button that changes modes from wysiwyg mode, to html/code mode.
=Don=
lstench
Regular
Posts: 16
Joined: Mon Nov 19, 2012 1:59 pm

Re: Can't embed code in post

Post by lstench »

I did use the source mode. It lets me add it but as soon as I push save it disappears and doesn't show up for hours on my blog and never shows up in the editor.
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: Can't embed code in post

Post by Timbalu »

So how did you get it to appear working fine in your entry, then?
What is the code you pasted into the editor?

. . .
I just did a quick test.
It appears to be like this: Insert as source code

Code: Select all

<iframe width="560" height="315" src="//www.youtube.com/embed/C6s22GxaCQ0" frameborder="0" allowfullscreen></iframe>
If I preview this entry, the preview looks fine, but the entry textarea shows nothing. And if furthermore saved, the fontend entry does not display the video.

If you put in the video and save the entry, all is well in the frontend. If you re-open this entry, the pasted iframe-code is gone and you would need to re-add it again before saving.

Solution: If using preview, or re-writing an entry please re-paste the video again, before saving.

I cannot tell you which funny bug or setting does make this happen like this, but it is some sort of iframe issue. Possibly in the CKEDITOR Javascript build.

We have to wait until they recognize this issue and solve it in a new version, I assume.
Or you could link yourself to the ckeditor forum and ask for help (and tell us afterwards!). :wink:

. . .
EDIT 2:
I found the issue, its incredible easy to solve. :D
CKEDITOR uses Advanced Content Filtering (ACF), which denies things like this.
Solution: Go to your backend → Manage Plugins → Event section → Ckeditor Plugin Configuration and set ACF turn off to true (YES).

In the ckeditor forum they say, the ckeditor plugin for embedding videos isn't fully working yet and the upper temporary ACF off solution isn't
... exactly the solution -- this setting will turn ACF off for anyone who's using it. The proper way to fix the issue is to update the plugin to comply with Advanced Content Filter and *not* to turn the filter off. for the whole editor.
You could also install the ckeditor plugin MediaEmbed from here https://github.com/frozeman/MediaEmbed since this has now solved the ACF issue by allowing iframe with media integraton.

This plugin is not part of the standard ckeditor package, since this has ACF and - if turned off - will also allow iframed videos. So in short, it is a decision of secureness.
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
lstench
Regular
Posts: 16
Joined: Mon Nov 19, 2012 1:59 pm

Re: Can't embed code in post

Post by lstench »

Thank you!! I was starting to think I was imagining things. I will edit the plugin. Is the MediaEmbed plugin safe to use?
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: Can't embed code in post

Post by Timbalu »

I never have used it, but having a look into the source it does not do anything unwanted, I presume. It opens a new dialog box per new toolbar icon to put the video iframe in.
https://github.com/frozeman/MediaEmbed/ ... /plugin.js

If that is something you are not sure about, just turn off ACF and your video is shown.
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
Post Reply