Hello everyone,
I am struggling with this for days. I got tinyMCE working smoothly with my Drupal installation so far. All I need now is an additional button that enables me to insert code (actionscript, java, php etc) and does some neat code formatting.
I tried geshi, codeFilter, and http://27smiles.com/2008/4/7/tinymce-syntaxhighlighter-plugin/
None of them worked at all, it was either tinyMCE replacing some tag characters or the plugin not working at all. All the tutorials I could find so far were poorly written and just mentioned the tinymce.init function.
This function seems to be used by Drupal slightly differen and I have no clue where to manipulate the settings used by drupal for this.
Can anyone point me to a decent manual, tutorial or explain the steps to integrate this from a Drupal point of view?
Thanks
Comments
Drupal + WYSIWYG + tinyMCE + syntaxhighlighter
The following is an interesting hack described by Clifford Meece - http://www.cliffordmeece.com/content/drupal-wysiwyg-tinymce-syntaxhighli...
He combines the WYSIWYG API module (with the tinyMCE JS library) and the Syntax highlighter module (with the syntaxhighlighter JS library) via the syntaxhl plugin (http://github.com/RichGuk/syntaxhl). I got it to work in Firefox but had difficulties with IE8 and Chrome see #385664: broken by WYSIWYG module.
Yep. I second the above.
Yep. I second the above. ^^^
(And yes, I know this is a bit late to the game here, but I got to this page from another source that was very active, so I thought I would go ahead and confirm my findings.)
Anyway, I've tried many times to integrate a working code highlighter into TinyMCE, and so far, this is the only approach I have found that really works. If you follow his (Clifford's) instructions using that link wgrunberg posted and make sure to turn on the actual filter at the end of the tutorial inside your input types, it should work. If any drawbacks exist with this, I haven't really seen any as of yet. The libraries being used limit some of your languages (i.e. - there is an SQL language that can be used but no T-SQL or PL/SQL, for example). Other than that, it works like a charm.
Note about my setup:
For informational purposes, I thought I would also mention that I also have "GeSHi Filter for Syntax Highlighting" installed as well. The version is 6.x - 1.4. This was the original code highlighting approach I was going to use, but now that I have this other option working, I'm questioning it's applicability... I suppose I might keep it for additional resources, but eh, I dunno... I might keep it for the more obscure languages.
Hope this helps.