This project is read-only.

Custom Theme / Custom TinyMCE js (tinyMCE.init)

Topics: Customizing Orchard, Writing themes
Nov 13, 2011 at 3:37 AM
Edited Nov 13, 2011 at 3:37 AM

Okay, I'm working on a theme that I'm planning to release to the world.  As part of this "social theme" I've been also wanting to release an update to the tinyMCE init method to include support for many social network tags that are otherwise stripped out like <g:plusbutton> etc.

The question is, how would I include a new file or extend the existing config file when it's really bundled as part of the tinyMCE config?

Nov 13, 2011 at 5:11 AM

You should be able to copy orchard-tinymce.js to the Scripts directory in your theme and make changes there.

Nov 14, 2011 at 4:53 AM

Sorry, that didn't work exactly.....

I copied it but nothing linked directly to it.

I took the Document.cshtml file and added it to my theme and then had it include my newly copied orchard-tinymce.js and that actually brings in the JS file for the main site but that isn't where orchard-tinymce.js is needed.  It's really needed on the admin editing, it appears that my theme isn't used and therefore it does not leverage my Document.cshtml.

Any thoughts on how my "non admin theme" could include script for certain elements within the admin pages?  I'd like to offer people using my theme the capability to have a tinymce configured with settings that are more commonly used by those typically associated with my theme.

Nov 14, 2011 at 10:37 AM

If you want to override admin stuff, you have to create a separate module. Theme overrides won't get applied in admin, because your theme isn't active at that time, however modules are active all the time.

Actually, it's better to implement this as a separate module, because then the functionality can be reused in any theme.