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.

Thanks
Larry

---
<?= "Jenolan(Larry) :: Coding Since 1973" ?>
Peace and Long Life

By jenolan - October 13, 2017

Probably ... outside I use the one by Alex Gorbatchev, I would go and make whatever changes are required but as with settings in the top of plugin files they are lost on the next update.

Larry

---
<?= "Jenolan(Larry) :: Coding Since 1973" ?>
Peace and Long Life

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

interactivetools.com

By jenolan - October 13, 2017

Heya,

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/

Larry

---
<?= "Jenolan(Larry) :: Coding Since 1973" ?>
Peace and Long Life

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

interactivetools.com

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 ;-)

---
<?= "Jenolan(Larry) :: Coding Since 1973" ?>
Peace and Long Life