Steve,

You were so helpful and clear on my last issue, I thought I might bring you another. I cannot seem to change the extended_valid_elements in the tinyMCE code to let my users to use regular old embed tags for customized youtube players. Why oh why can't I figure this out? The code snippets I've tried haven't been for drupal in particular, but they go something like this:
tinyMCE.init...
extended_valid_elements : object[width|height|classid|codebase],param[name|value],embed[src|type|width|height|flashvars|wmode]“
Do you have any idea about where I might be screwing up?
Thanks again,

ALEX
www.youfitter.com

Comments

Steve Lockwood’s picture

Hi Alex,

Can you post the whole init string that you are using - that might help me to spot it.

Steve

Steve Lockwood’s picture

I wasn't sure if you had cut down the extended_valid_elements line in your post to show just the relevant bits.

My thought was that there might be another line defining extended_valid_elements lower down the script (the second would, of course, take precedence over the first). If there are two such lines, you will need to merge them together.

Also, in the example you give, the part after the colon should begin with a quote mark, could that be the problem?

// wrong
extended_valid_elements : object[width|height|classid|codebase],param[name|value],embed[src|type|width|height|flashvars|wmode]“
// right
extended_valid_elements : "........,object[width|height|classid|codebase],param[name|value],embed[src|type|width|height|flashvars|wmode]“

But I'm guessing as to what the problem may be - please sent the full init script if you want me to look in more detail.

alexevasion’s picture

I don't think there is another line, but perhaps I'm going about this the wrong way. People talk about their html getting stripped, but mine seems intact when I view it on the page... it just doesn't call the embedded video. Can you embed videos on your installation? Here's a page to check out if you get a chance - http://youfitter.org/node/46 - thanks again,
ALEX

function tinytinymce_advanced() {
return '
tinyMCE.init({
mode : "exact",
elements: "edit-body",
file_browser_callback: "imceImageBrowser",
theme : "advanced",
convert_urls : false,
plugins : "safari,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template",
theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,formatselect,fontselect,fontsizeselect, | |,forecolor,backcolor, ",
theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,preview,fullscreen,",
theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,",
theme_advanced_buttons4 : ",styleprops,|,cite,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_statusbar_location : "bottom",
theme_advanced_resizing : true,
extended_valid_elements : "a[name|href|target|title|onclick],img[style|class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style],object[width|height|classid|codebase],param[name|value],embed[src|type|width|height|flashvars|wmode],iframe[src|name|class|style|frameborder|SRC|height|width]",
template_external_list_url : "example_template_list.js"
});
';

Steve Lockwood’s picture

It's taken me a long while to get back to this - sorry.

I'm using the default init script for advanced (you can reset to defaults in the admin screen).
I clicked on the media button (looks like a film reel)
This gives me a popup where I specify the media type and its URL (works even better if you install IMCE, which gives you a browser and an uploader installed as a button in the popup)
You can then set the various options for the media.

Would this do the job for you?

Steve

Steve Lockwood’s picture

Status: Active » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

m.e.’s picture

Status: Closed (fixed) » Active

Can this be re-opened with a request that we back up a bit?

I'm also having major issues trying to embed YouTube objects. Do I need to alter the TinyTinyMCE files to fix the problem, or is there some other workaround?

When I go into "HTML" mode, insert the code along with my page text, then hit "UPDATE", only my page text is preserved. The video is not on the page. If I go back into HTML, the video's object code is nowhere to be seen. Pasting it in and updating a second time doesn't do it.

I have attempted to create the page using Rich Text, which at least gives me the video on the preview page (with an empty TinyTinyMCE editor below it). As soon as I hit save that video, too, disappears.

Steve Lockwood’s picture

Sorry for the delay in replying. You should not need to alter the files of the module. The admin screen (admin/settings/tinytinymce) contains the init script for the editor and it is this that might need alteration. Documentation for the init script can be found at http://wiki.moxiecode.com/index.php/TinyMCE:Index.

I hope this helps. Changing status back to "fixed" but please reopen if I've missed the point.

Steve