Embedding videos in kupu
This How-to applies to:
Plone 2.5.x
This How-to is intended for:
Site Administrators, Integrators, Customizers, Developers
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'
dont' forget <param>!