TinyMCE plugin support?

Topics: Writing modules
Apr 14, 2011 at 6:46 AM

I am looking at a a module like the Syntax Highlighter module in WP where it adds a plugin to the TinyMCE library to add support for formatting the entered text as source code.

Is there a way to allow adding a script to be added to the page when the editor view for a body part is being rendered? This is what I feel like I need to do in order to do this, but It seems like this is breaking the module isolation principles.

Apr 14, 2011 at 9:40 AM

There's already a Syntax Highlighter module in the Gallery:


Apr 14, 2011 at 9:48 AM

Yup, and there is no support for formatting the HTML for use with the syntax highligher js. So unless you want to manually enter blog posts by writing directly into the HTML window, it is kind of crap to use.

If Wordpress can do it, there must be a way to get orchard to do it.

Apr 14, 2011 at 10:09 AM

There's definitely a way. You can certainly add scripts to an editor view by either overriding the view or adding your own part.

Look at how the existing syntax highlighter works and also how the Wordpress plugin does it I guess ...