Disable one mockup pattern

Hi all!

I'm integration mockup via Asko's webpack plugin and due to our own needs we are bundling and bootstraping TinyMCE ourselves. Still tinyMCE (from mockup) gets loaded.

Is there a way to disable a specific pattern so that it gets disabled on the resource registry and thus the webpack plugin does not fetch it?

I would use a custom plone-logged-in.js bundle configuration file (See: https://github.com/plone/Products.CMFPlone/blob/master/Products/CMFPlone/static/plone-logged-in.js ) . Just register your own by overriding the plone-logged-in bundle resource config in registry.xml ( https://github.com/plone/Products.CMFPlone/blob/master/Products/CMFPlone/profiles/dependencies/registry.xml#L1038 ). Leave out the TinyMCE pattern there. You might also want to leave out the TinyMCE styles from https://github.com/plone/Products.CMFPlone/blob/master/Products/CMFPlone/static/plone-logged-in.less

After you overridden these files you need to recompile your bundle.

I would also override the bundle compilation files to point to a plone.resource directory within your project: https://github.com/plone/Products.CMFPlone/blob/master/Products/CMFPlone/profiles/dependencies/registry.xml#L1078 - otherwise you end up compiling them into CMFPlone/static which you really shouldn't commit and push without tinymce.


Thanks! I will have a look and report back!

@thet thanks it did work!

As I'm using @datakurre's webpack plugin I skipped the last part (the bundle compilation).

1 Like

@gforcada With Webpack-built theme you may also drop the bundle registration part. You only need to copy plone-logged-in from Plone into your theme, customize it and require it directly (instead of using "plone-logged-in"-alias).

@datakurre now I see my actual problem:

On the logged-in.js I did remove the tinymce line on the require list, but the mockup-patterns-textareamimetypeselector depends on it, so tinymce was being loaded anyway. :tada:

Cool, then not even chagnes on registry.xml are needed.

textareamimetypeselector pattern actually replaces tinymce pattern when other mime types than text/html is allowed