Embedding Videos with TinyMCE

By default TinyMCE strips out any code that you would use to embed videos or Flash into your site. To allow videos to be embedded you need to change how TinyMCE init’s.

Mainly, the valid_elements, extended_valid_elementsvalid_child_elements parts of the code.

Use the following code

[codesyntax lang=”html4strict”]
theme_advanced_buttons1 : “bold,italic,underline,separator,bullist,numlist,formatselect,link,unlink,separator,undo,redo,separator,code,media”,
theme_advanced_buttons2 : “”,
theme_advanced_buttons3 : “”,
theme_advanced_toolbar_align : “center”,
theme_advanced_statusbar_location : “bottom”,
theme_advanced_resizing : true,
valid_elements : “a[name|href|title|class],b/strong,i,br,p,img[src|width|height|alt|title|class]”,
extended_valid_elements : “param[name|value],embed[src|type|wmode|width|height],object[classid|codebase|width|height],iframe[frameborder|src|width|height]”,
valid_child_elements : “table[thead|tbody|tfoot|tr|td],object[param|embed],embed[param]”
});

Author: Kieran Barnes

Kieran is a PHP developer with 15 years commercial experience. Specialist in WordPress, CakePHP, CubeCart and all things PHP.

Leave a Reply

Your email address will not be published. Required fields are marked *