I want to allow users to insert links with a class in the TinyMCE editor <a class="btn btn-primary">, where I stole CSS from Twitter Bootstrap's buttons.
Before I reinvent the wheel, is there a preferred or recommended method to do so? I found a couple of suggestions.
Is there a preferred method to editing a resource's registry.xml?
I found Site Setup > Configuration Registry, and filtered by Products.CMFPlone.interfaces.controlpanel.ITinyMCESchema. I edited the record, and it seems to have been updated, but does not take effect in TinyMCE Formats menu. Do I need to restart or reload something?
I also tried exporting Products.CMFPlone.interfaces.controlpanel.ITinyMCESchema.xml, editing that, and importing it. Same result. Record appears updated, but no change to TinyMCE Formats menu.
Create a new LESS file to contain custom styles, say /less/custom.less. For this I stole the btn styles from Twitter Bootstrap 4, but I had to vendor them in as tbbtn to avoid style conflicts in Barceloneta.
Open /less/barceloneta.plone.less, and add these two lines to the end:
//*// Customizations
@import "custom.less";
Tools > Build CSS
In Site Setup > TinyMCE Settings > Advanced, paste the following: