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

---



Peace and Long Life

By Damon - October 13, 2017

Hi,

Are you referring to this TinyMCE Code Sample plugin?
https://www.tinymce.com/docs/plugins/codesample/

Cheers,
Damon Edis - interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

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

---



Peace and Long Life

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

---



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

---



Peace and Long Life