The Joomla! Forum ™



Forum rules


Please use the Forum Post Assistant to give your server setting details which are necessary to determine the problem.



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 16 posts ] 
Author Message
PostPosted: Wed Jul 07, 2010 11:01 am 
Joomla! Explorer
Joomla! Explorer

Joined: Mon Dec 15, 2008 11:10 am
Posts: 337
Hi

I try to insert a video into an article using the TinyMCE in extended mode.

I click the button: "Insert / Edit embedded media"

Then I paste an url from [youtube] into the File / URL field in the dialog box.
Type: Flash
When I leave the "File / URL" field, then the video show up in the preview area in the dialogbox.

Now, when I click Insert, I only see a yellow square with a flash icon in the middle.

When I save it and show the article on the frontend, then no video is displayed.

What do I have to do to make this work?


Top
 Profile  
 
PostPosted: Wed Jul 07, 2010 11:43 am 
User avatar
Joomla! Guru
Joomla! Guru

Joined: Tue Aug 05, 2008 11:34 am
Posts: 505
Location: Hyderabad
Disable the TinyMCE in Global Configuration or For a particular user account.Then it should work.


Last edited by srikanthg on Wed Jul 07, 2010 11:53 am, edited 1 time in total.

Top
 Profile  
 
PostPosted: Wed Jul 07, 2010 11:50 am 
Joomla! Explorer
Joomla! Explorer

Joined: Mon Dec 15, 2008 11:10 am
Posts: 337
srikanthg wrote:
Disable the TinyMCE in Global Configuration or For a particular user account.Then it should word.


Could you please be more specific?
I do not understand what you mean.


Top
 Profile  
 
PostPosted: Wed Jul 07, 2010 12:03 pm 
User avatar
Joomla! Guru
Joomla! Guru

Joined: Tue Aug 05, 2008 11:34 am
Posts: 505
Location: Hyderabad
In your Global Settings set editor to "No Editor" and insert video.
OR
Create a new user account and set User Editor as "No Editor" for that user.Then login with this user account and embed videos in articles.


Top
 Profile  
 
PostPosted: Wed Jul 07, 2010 12:31 pm 
Joomla! Explorer
Joomla! Explorer

Joined: Mon Dec 15, 2008 11:10 am
Posts: 337
Hi

This sounds like a pretty weird solution.
Do you tell your customers to use your "workaround"? I definitely do not want to do that!

I want to use the TinyMCE built in solution for inserting videos to an article.
Why is it not working in TinyMCE, in Joomla 1.6 as is, and how can I make it work?

Maybe the TinyMCE editor in Joomla 1.6 filter away some tags when the code is inserted into the editor when I click the Insert button in "Insert / Edit embedded media" dialog....?
Does anybody know if this is the case?


Top
 Profile  
 
PostPosted: Wed Jul 07, 2010 12:47 pm 
User avatar
Joomla! Guru
Joomla! Guru

Joined: Tue Aug 05, 2008 11:34 am
Posts: 505
Location: Hyderabad
bongobongo wrote:
Hi
I want to use the TinyMCE built in solution for inserting videos to an article.
Why is it not working in TinyMCE, in Joomla 1.6 as is, and how can I make it work?

Maybe the TinyMCE editor in Joomla 1.6 filter away some tags when the code is inserted into the editor when I click the Insert button in "Insert / Edit embedded media" dialog....?
Does anybody know if this is the case?

All WYSIWYG editors strip any code pasted in them if they don't understand properly.
Use some plugins to embed media :http://extensions.joomla.org/extensions/812/details


Last edited by srikanthg on Wed Jul 07, 2010 2:29 pm, edited 1 time in total.

Top
 Profile  
 
PostPosted: Wed Jul 07, 2010 2:19 pm 
Joomla! Explorer
Joomla! Explorer

Joined: Mon Dec 15, 2008 11:10 am
Posts: 337
Hi

I appreciate the feedback

But none of them works in Joomla 1.6.
Well, disabling TinyMCE might work, but is not an option for me.
JoomlaWorks AllVideos are joomla 1.5 compatible.

I find it hard to belive that there is no setting in Joomla 1.6 that enable the inserted code from the TinyMCE "Insert / Edit embedded media" dialog to actually be inserted without beeing filtered.

I find in Joomla 1.6 in "Article managers" -> Options dialog -> Tab: Text filters

Is it not possible to set up Text filters in such way that the inserted code from the TinyMCE "Insert / Edit embedded media" dialog actually works (not get filtered)?

Anybody?

*** UPDATE ****

Here is the code that should have been inserted when using
the TinyMCE "Insert / Edit embedded media" dialog
(this is what is in the preview area of the dialog if you inspect it):


Code:
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" width="300" height="200" id="obj" name="eobj" align=""><param name="src" value="http://www.[youtube].com/v/LTGwBpigmKw&amp;feature"><param name="url" value="http://www.[youtube].com/v/LTGwBpigmKw&amp;feature"><param name="width" value="300"><param name="height" value="200"><param name="id" value="obj"><param name="name" value="eobj"><param name="align" value=""><embed type="application/x-shockwave-flash" src="http://www.[youtube].com/v/LTGwBpigmKw&amp;feature" width="300" height="200" id="obj" name="eobj" align=""></object>


Here is the code that is actually left when looking at the code in TinyMCE after inserting the video:

Code:
<img src="http://www.mydomain.no/socrith/media/editors/tinymce/jscripts/tiny_mce/plugins/media/img/trans.gif" mce_src="media/editors/tinymce/jscripts/tiny_mce/plugins/media/img/trans.gif" class="mceItemFlash" title="src:'http://www.[youtube].com/v/LTGwBpigmKw&amp;feature',width:'300',height:'200'" width="300" height="200" align=""><br mce_bogus="1">


Now if someone could tell me how to use the
"Article managers" -> Options dialog -> Tab: Text filters


so the video related stuff not get filtered out, then things would look a lot brighter

I have tried to do this the following here:
"Article managers" -> Options dialog -> Tab: Text filters

I have selected "Administrator" and "Super users" from "Filter groups"
Then I set "Filter type" to "Blacklist (Default)"
"Filter tags" and "Filter attributes" are both empty.

Then I try to insert a video into an article using the TinyMCE butto:
"Insert / Edit embedded media"

Flash, and just insert a [youtube] URL to the video.
The code that is inserted when I click Insert button in the dialog still gets filtered.... bahhhhh

Is the text filters not working yet?


Top
 Profile  
 
PostPosted: Thu Jul 08, 2010 5:13 am 
Joomla! Fledgling
Joomla! Fledgling

Joined: Thu Jul 08, 2010 5:01 am
Posts: 3
In my trials making changes to the text filter features in the Joomla admin does not appear to be working correctly.
As a temporary measure I have removed the black list used in the text filtering altogether:

In the filterinput.php file I deleted all the items from the blacklist arrays I didn't want blacklisted. You can probably just delete the ones that are used in your video code.

e.g.

Line 51
Code:
    * @var   array   A list of the default blacklisted tags.
    */
   var $tagBlacklist = array ('applet', 'body', 'bgsound', 'base', 'basefont', 'embed', 'frame', 'frameset', 'head', 'html', 'id', 'iframe', 'ilayer', 'layer', 'link', 'meta', 'name', 'object', 'script', 'style', 'title', 'xml');

   /**
    * @var   array   A list of the default blacklisted tag attributes.
    */
   var $attrBlacklist = array ('action', 'background', 'codebase', 'dynsrc', 'lowsrc'); // also will strip ALL event handlers


Line 51
Code:
    * @var   array   A list of the default blacklisted tags.
    */
   var $tagBlacklist = array ('body');

   /**
    * @var   array   A list of the default blacklisted tag attributes.
    */
   var $attrBlacklist = array ('lowsrc'); // also will strip ALL event handlers


Top
 Profile  
 
PostPosted: Thu Jul 08, 2010 6:00 am 
Joomla! Explorer
Joomla! Explorer

Joined: Mon Dec 15, 2008 11:10 am
Posts: 337
A bug has been opened in the tracker:

See:
http://joomlacode.org/gf/project/joomla ... m_id=21338

I really hope this will be fixed ASAP.


Top
 Profile  
 
PostPosted: Thu Jul 08, 2010 6:26 am 
Joomla! Explorer
Joomla! Explorer

Joined: Mon Dec 15, 2008 11:10 am
Posts: 337
I tried to change the filterinput.php so $tagBlacklist and $attrBlacklist look like this:

Code:
 * @var   array   A list of the default blacklisted tags.
    */
   var $tagBlacklist = array ('body');

   /**
    * @var   array   A list of the default blacklisted tag attributes.
    */
   var $attrBlacklist = array ('lowsrc'); // also will strip ALL event handlers


Did not work after that change was made... by some reason....
Anything else that need a change to make it work?


Top
 Profile  
 
PostPosted: Thu Jul 08, 2010 7:22 am 
User avatar
Joomla! Guru
Joomla! Guru

Joined: Tue Aug 05, 2008 11:34 am
Posts: 505
Location: Hyderabad
bongobongo wrote:
Hi
JoomlaWorks AllVideos are joomla 1.5 compatible.

I guess this Plugin should work with J1.6 also(but i did't check).Check it and let me know how it works.


Top
 Profile  
 
PostPosted: Thu Jul 08, 2010 8:31 am 
Joomla! Explorer
Joomla! Explorer

Joined: Mon Dec 15, 2008 11:10 am
Posts: 337
Please do not post anymore JoomlaWorks stuff in this thread!

This thread is about inserting videos using TinyMCE editor.


Top
 Profile  
 
PostPosted: Thu Jul 08, 2010 2:57 pm 
Joomla! Explorer
Joomla! Explorer

Joined: Mon Dec 15, 2008 11:10 am
Posts: 337
Found something interesting:

When you click the "Insert" button in the "Insert / Edit embedded media" dialog in TinyMCE
then it run the JS function "insertMedia()" in this file:
/media/editors/tinymce/jscripts/tiny_mce/plugins/media/js/media.js

What happens is that this test:
Code:
if (fe != null && /mceItem(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)/.test(ed.dom.getAttrib(fe, 'class'))) {


never runs, which cause the function to run the code inside the ELSE block instead, and I belive this just output an IMG tag.

If somebody understand how to make the first part of the IF to work, please post an explanation here?

*** UPDATE - tested in joomla 1.5.x ****
I have tested the same feature in TinyMCE in Joomla 1.5.x
The code in media.js for that version look very similar to the code used for Joomla 1.6.
In Joomla 1.5.x it does not strip away the object tag, in the editor it does not look good because the only thing I see there is a yellow "placeholder" for the video, but when one view the article on the front-end then it works like a charm.
So I guess it must be the Text filter bug that causes the problems in joomla 1.6


Top
 Profile  
 
PostPosted: Thu Aug 12, 2010 2:12 pm 
Joomla! Explorer
Joomla! Explorer

Joined: Mon Dec 15, 2008 11:10 am
Posts: 337
I just want to confirm that the "hack" presented by f3cp earlier in this thread actually do work.

What I did was to edit this file:

/libraries/joomla/filter/filterinput.php

And change this variable ($tagBlacklist) so it look like this: (just removed object and embed):

Code:
var $tagBlacklist = array ('applet', 'body', 'bgsound', 'base', 'basefont',
'frame', 'frameset', 'head', 'html', 'id', 'iframe', 'ilayer', 'layer', 'link',
'meta', 'name', 'script', 'style', 'title', 'xml');


You do not even have to mess with the "Extended Valid Elements" in the TinyMCE plugin, leave it empty.
But you might have to set "Functionality": to Extended in the plugin, in order to see the "Insert / edit embedded media" button (the one that looks like a film-strip).

This way you can omit the bug in Joomla (that the dev team are working to fix) and finally be able to insert video into your Joomla 1.6 articles, when using TinyMCE.

Just be aware that next time you update Joomla 1.6 you will have to remember to replace the filterinput.php file.

Hope this helps some other that otherwise have to use hours to figure this mess out.


Top
 Profile  
 
PostPosted: Sat Feb 26, 2011 11:58 pm 
Joomla! Fledgling
Joomla! Fledgling

Joined: Thu May 06, 2010 11:25 pm
Posts: 4
the hack that bongobongo suggested worked great for me even while using a different editor (CKEditor). So this could be a universal quick fix. Thanks for your help!


Top
 Profile  
 
PostPosted: Fri Mar 25, 2011 3:13 am 
Joomla! Apprentice
Joomla! Apprentice

Joined: Fri Jan 07, 2011 2:15 am
Posts: 10
Nice... This was bugging the s*** out of me. Thanks for posting that fix guys. Works great for me! There's gotta be a more user friendly way to adjust what tags are filtered from the back end. Hopefully they fix that.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 16 posts ] 



Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group