Add bramus_cssextras plugin to TinyMCE Inputfield
2013/12/14 1:40 PM • ProcessWire • Tutorial • Comments (0)
Since a latest updates to TinyMCE inputfield there's an option to add custom plugins from outside the core to TinyMCE on a per field basis. Here's an example how to add the bramus_cssextras plugin.
- create a directory in your site folder i.e. "/site/tinymce"
- create a plugins folder in it i.e. "/site/tinymce/plugins"
- put the folder "bramus_cssextras" in there
- put a content.css in the "tinymce" folder (this is where you can define classes or id's, like: p.lead {...}, ul.list {}, h2.red{ ... } ) (see bramus_cssextras homepage for further infos)
- now go to the TinyMCE field you want to use it. Under tab "Input" you'll see a "TinyMCE Advanced Configuration Options" collapsed. Open it.
- add the buttons to one of the theme_advanced_button fields: "bramus_cssextras_classes, bramus_cssextras_ids" if you don't need id's leave it out
- add the content.css to the content_css field setting like: "/site/tinymce/content.css"
- add plugin to "Third-party plugin" textarea field like: "bramus_cssextras: /site/tinymce/plugins/bramus_cssextras" as one line.
Done. You should now be able to select the class "lead" when cursor inside a <p> tag. Add as much css classes or id's to the content.css as you wish, bramus_cssextras will autodetect them.
Have fun.
2013/12/14 1:40 PM | ProcessWire | Tutorial