Editor -- Code Syntax

7 posts by 3 authors in: Forums > CMS Builder
Last Post: October 16, 2017   (RSS)

By jenolan - October 8, 2017

Up to one of the next things I am moving from WP to cmsb.... Code Snippets I am pretty sure that the TinyMCE has 'Code Syntax' capability but how can I enable this for a field .. or have the field set as 'Language' with Text that then is shown properly.



By Damon - October 13, 2017


Are you referring to this TinyMCE Code Sample plugin?

Damon Edis - interactivetools.com

Hire me! Save time by getting our experts to help with your project.

By Dave - October 13, 2017

Hi Larry, 

Can you give more details on what you're trying to do?  We made an "Insert Programming Code" button for the forum.  We're still running TinyMCE 3 for the forum.  So we need to upgrade to TinyMCE 4 at some point and have a look what code snippet options there are.  Is what you're looking for a plugin for TinyMCE 4 that allows you to display programming code in a formatted way? 

Dave Edis - Senior Developer

By jenolan - October 13, 2017


All that I want to do is drop code snippets into the editor and have the display with formating, my wp section https://jenolan.org/wp/code-snippets/



By Dave - October 16, 2017

Hi Larry, 

Yea, I just tried it.  That's pretty much what it does.  It uses this library: http://prismjs.com/

I just added "codesample" to the plugins and toolbar config lines as per the instructions here: https://www.tinymce.com/docs/plugins/codesample/ and it worked right away.  Just save your wysiwyg.php as wysiwyg_custom.php to prevent it from getting overwritten when you upgrade.

Hope that helps!  We'll probably switch to this plugin when we update the forum WYSIWYG.

Dave Edis - Senior Developer

By jenolan - October 16, 2017

G'day, done and dusted.....

Also for forum you need a 'mark as read' to clear the new post indicator ;-)