Using Syntax highlighter in Tinymce with syntaxhl
Syntax highlighter is important for programmers, coders and developers to post their code syntax online which will stand highlighted and look pretty in any article or blog. Today we will discuss how to add Syntax highlighter in Tinymce so that user can add their code in their article properly.
First download Syntax highlighter from here and add in the directory where you put Tinymce.
Now download a plugin which will add syntax highlighter code to the syntax in Tinymce there are some plugin available we are using syntaxhl which you can download from here.
Now add this plugin in the folder of plugins in Tinymce then the path will become
tiny_mce/plugins/syntaxhl
Now add the syntaxhl in the plugin list where rest of the Tinymce plugins are listed which will add the highlighter image in toolbar given with syntaxhl plugin.
Now where you want to add the highlighter code add the Highlighter script brushes files and add script for Syntax highlighter like below
This syntax will trigger the Syntax Highlighter where it will find the brush class. Syntax Highlighter is has vast collection of programming languages which will make easy for any developer to add code snippet in blog articles easily.
First download Syntax highlighter from here and add in the directory where you put Tinymce.
Now download a plugin which will add syntax highlighter code to the syntax in Tinymce there are some plugin available we are using syntaxhl which you can download from here.
Now add this plugin in the folder of plugins in Tinymce then the path will become
tiny_mce/plugins/syntaxhl
Now add the syntaxhl in the plugin list where rest of the Tinymce plugins are listed which will add the highlighter image in toolbar given with syntaxhl plugin.
$('textarea.tinymce').tinymce({ script_url: '/adminpath/tiny_mce/tiny_mce.js', theme : "advanced", skin:"Advanced", language:"en", plugins :"autosave,wordcount,lists,preview,paste,tabfocus,autolink,syntaxhl", theme_advanced_buttons1 :"bold,italic,underline,|,fontselect,|,syntaxhl,", theme_advanced_buttons2 : "cut,copy,paste,|,link,unlink,anchor,image,", relative_urls : false });When you click on the highlighter button the new window will be opened where you can paste your code, select language, highlight options, toolbar options.

Now where you want to add the highlighter code add the Highlighter script brushes files and add script for Syntax highlighter like below
This syntax will trigger the Syntax Highlighter where it will find the brush class. Syntax Highlighter is has vast collection of programming languages which will make easy for any developer to add code snippet in blog articles easily.
Tags:
Tinymce
Syntaxhighlighter

Zubaida
Zubaida is web developer having vast experience working in HTML5, CSS3, Javascript, PHP and SEO. Currently writes for Knowledge Aspire sharing her experiences and thoughts on various technologies.
Get latest updates in your inbox
Popular Posts
How Yoga Nurtures Your Programming Skills
Understanding and analyzing basics of SEO
Creating SEO friendly URLs with PHP and SQL
Adobe AIR - Developing cross platform applications
Writing functions to insert, update, search, delete from SQL tables in PHP
Getting started with C#
Creating XML sitemap with PHP and SQL and submitting to search engines
Creating RSS feed in xml format with PHP and SQL
Creating thumbnails dynamically from images with PHP
Backup SQL database with PHP
Tags
CSV
Validation
Android
Java
Nashorn
PHP Mailer
cPanel
Facebook
Marketing
AdSense
Google
Technorati
Feathers
Starling
crop
PDF
Yoga
feedburner
rss feed
meta tags
SQL
backup database
Adobe Air
XML Sitemap
Syntaxhighlighter
Uploadify
Tinymce
screenshot
Text image
webmaster tools
Verifying website
web analysis
SEO
visual studio 2013
IDE