When I edit a page using Display > View Document, I can insert a JavaScript widget as source code and it renders just fine.
But when I edit a page using Display > Mosaic Layout, when I insert the same JavaScript widget, TinyMCE inserts type="mce-text/javascript" into the <script> tag, and the widget does not render.
Is there a way to get Mosaic's TinyMCE editor to behave like the default TinyMCE editor?
If not, is there a workaround to allow a user to embed HTML snippets that contain <script> tags verbatim using Mosaic?
My theme is a copy of the Barceloneta theme, slightly modified TTW. It does not have a fragments folder. If I create the folder fragments at the root of the theme, and put stuff inside, should it "just work"? I think I'm missing something.
If you have an add-on/theme, add it to your registry.xml. It is also possible to add the required records TTW using the configuration registry (either manually or import an XML file).
I saved that code snippet as plone.app.standardtiles.rawembed.xml and tried to import it via Site Setup > Configuration Registry. It seems to succeed, but it does not appear in the Records table. After creating a new record, does something else need to be done?
It shows up as a Mosaic Tile. However when I click Insert > Theme Fragment, select embedded_widget, and click Save, I get a ISE 500 with the following response:
{"error_type": "AttributeError"}
Comparing my experience to this video at 159 seconds in:
I get as far as the first form in the modal dialog, but the second form never appears.
<html>
<div>Dummy text, Just for now, have a div so the fragment is not empty</div>
${view/data/embeddedwidget|None}
</html>
I don't see any typos.
Here's the full source of the widget when it gets rendered:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<body><div>Dummy text, Just for now, have a div so the fragment is not empty</div>
<script src="https://example.com/++resource++protect.js" type="application/javascript" id="protect-script" data-token="27204664035a7ea5f2d380fc235f8f38f9aa29eb" data-site-url="https://example.com"></script></body></html>
Python 2.7.15+ (default, Oct 7 2019, 17:39:04) [GCC 7.4.0] # Could this be a Unicode issue?
PIL 6.2.1 (Pillow)
WSGI: On
Server: waitress 1.4.2
plone.app.blocks-4.3.2
plone.app.contenttypes-2.1.5
plone.app.drafts-1.1.3
plone.app.layout-3.4.0
plone.app.mosaic-2.2.1
plone.app.standardtiles-2.3.2
plone.app.tiles-3.1.2
plone.behavior-1.3.0
plone.jsonserializer-0.9.7 # is this not sufficient?
plone.subrequest-1.9.1
plone.tiles-2.2.1
collective.themefragments-2.12
I've been meaning to migrate this system to Python 3, now that the Ansible playbook for Plone supports it. That's the only thing I think that could affect this. Thanks for checking on your system.