Personal tools
You are here: Home Documentation How-tos Embedding videos in kupu
Support

Get Help

Join our chat rooms or support forums if you have more specific questions.

Plone Training
Learn how to design, build, and deploy a website in Plone through one of the numerous Plone training sessions around the world.
Find Plone training…
 
Document Actions

Embedding videos in kupu

This How-to applies to: Plone 2.5.x
This How-to is intended for: Site Administrators, Integrators, Customizers, Developers

Since version 1.4 (still in active development), Kupu supports embedding videos or rather does not prevent you from doing it. Here's how to make Plone play nicely, too.

You'll need to disable or subdue Plone's safe_html transform.

The easy way is the go to the portal_transforms-tool in the ZMI, then safe_html, and remove the 'embed' and 'object' rows from nasty_tags and add them to the list of valid tags with a '1' indicating that these tags consists of an open and close part.

Another way is to do this programatically, in an install-script (it's a bit ugly, but it works):

def setupTransforms(portal, out):
from Products.CMFDefault.utils import VALID_TAGS
from Products.CMFDefault.utils import NASTY_TAGS

valid_tags = VALID_TAGS.copy()
nasty_tags = NASTY_TAGS.copy()

nasty_tags.pop('embed')
nasty_tags.pop('object')

valid_tags['embed'] = 1
valid_tags['object'] = 1

kwargs = {'nasty_tags': nasty_tags,
'valid_tags': valid_tags}

transform = getattr(getToolByName(portal, 'portal_transforms'), 'safe_html')

for k in list(kwargs):
if isinstance(kwargs[k], dict):
v = kwargs[k]
kwargs[k+'_key'] = v.keys()
kwargs[k+'_value'] = [str(s) for s in v.values()]
del kwargs[k]

transform.set_parameters(**kwargs)

print >> out, "Transforms updated."

Finally, you could also patch ATDocument to use a more relaxed transform. Only do this if you trust the people who have permissions to edit documents. The following patch should be called from an __init__.py-script in a product on the filesystem:

def apply_allow_unsafe_html_patch():
from Products.ATContentTypes.content import document as atdocument
atdocument.ATDocumentSchema['text'].default_output_type = 'text/x-html-captioned'
by Malthe Borch last modified June 6, 2007 - 09:13 All content is copyright Plone Foundation and the individual contributors.

dont' forget <param>!

Posted by Jon Stahl at January 4, 2008 - 02:52
the param tag is also frequently used by embeddable media players, and should be enabled, too! Perhaps you can merge in the directions from http://plone.org/documentation/how-to/how-to-embed-content-flickr-youtube-or-myspace ?

For any issues with the web site functionality, please file a ticket.

Please consult the policy on plone.org content if you want your content published on this site.

Servers and hosting by