This project is read-only.

no tinymce editor,no syntax highlighter in blogengine 2.9

Topics: Business Logic Layer
Jan 7, 2014 at 9:01 AM
is there any way to integrate blogengine 2.8 tinymce editor with syntax highlighter in be2.9 or integrate syntax highlighte in be2.9 editor as i found there is no syntax highlighter in be2.9 current editor
Jan 7, 2014 at 3:01 PM
You will be able to switch editors in the next version, but now it only works with bootstrap editor. It can be extended for things like syntax highlighter, with some basic JavaScript coding.
Jan 7, 2014 at 3:08 PM
Jan 9, 2014 at 3:12 PM
hi, i have the same problem too. Upgraded from 2.5 to 2.9v. Everything works perfect except Syntaxhighlighting.

Is there any temporary solutions for this until next update? I mostly blog code parts so.

Can you share some how to fix links or explain?

thank you.
Jan 9, 2014 at 5:03 PM
You should be able to switch to source vie in editor and add snippet like this:
<pre class="brush: c-sharp;">// example.cs
function foo()
    var bar = 1;
Jan 10, 2014 at 12:40 AM
You can also use Windows Live Writer

Then install the plugin

Or use another plug that works best for you.

Example Post with the Plug in Paste as Visual Studio Code

All you do is open up Visual Studio copy the code you want to post.

Go to Windows Live Writer and in go to "Insert" Select the VS Paste from the plugin menu and click paste.

The code shows up in your post and options menu on the right.
Jan 10, 2014 at 6:34 AM
Edited Jan 10, 2014 at 6:35 AM
Thanks, Kbdavis.
Jan 26, 2014 at 12:51 AM

I can see that you would need to add a button to the _editor.cshtml file and that is easy enough. I have even had success using the data-edit="formatBlock" examples and can get it to add the <pre> and </pre>. What I need some direction on is what script is the data-edit="formatBlock" callling (this may not be the right term)? I would need to see examples and then maybe I could extend for Syntaxhighlighter.
Jan 26, 2014 at 6:21 PM
We using this editor: so you might look at examples on their site.
The "formatBlock" as far as I know is a "browser command", it is implemented by browser and not customizable. But you can run any javascript on new button click and change text in the editor to whatever you want.
Jan 28, 2014 at 1:01 AM
Thanks. I see what I can do.
Jan 28, 2014 at 1:59 AM
Edited Jan 28, 2014 at 2:13 AM
This will work as a quick workaround until I can try to learn more about how to extend the editor with javascript. This works in Chrome and Firefox but not in IE. In Firefox there is and extra "<br>" that is added just before </pre> and you need to go into html edit mode to remove it before saving/publishing.

Go to the file admin>editor>_editor.cshtml. Towards the end of the document add the below just before "</div><div class="editro-switch">". This will add a dropdown list that you can select from BEFORE you add your code.

Also, you need to paste your code while in html edit mode.

This seems to be a good alternative to using WLW.
<div class="btn-group">
            <button type="button" tabindex="-1" class="btn btn-default dropdown-toggle" data-toggle="dropdown" title="Insert Code"><i class="fa fa-heading"><b>#</b></i><span class="caret"></span></button>
            <ul class="dropdown-menu heading-item">
                <li><a data-edit="insertHTML <pre class='brush: as3'>">ActionScript3</a></li>
                <li><a data-edit="insertHTML <pre class='brush: bash'>">Bash/shell</a></li>
                <li><a data-edit="insertHTML <pre class='brush: cf'>">ColdFusion</a></li>
                <li><a data-edit="insertHTML <pre class='brush: c-sharp'>">C#</a></li>
                <li><a data-edit="insertHTML <pre class='brush: cpp'>">C++</a></li>
                <li><a data-edit="insertHTML <pre class='brush: css'>">CSS</a></li>
                <li><a data-edit="insertHTML <pre class='brush: delphi'>">Delphi</a></li>
                <li><a data-edit="insertHTML <pre class='brush: diff'>">Diff</a></li>
                <li><a data-edit="insertHTML <pre class='brush: erl'>">Erlang</a></li>
                <li><a data-edit="insertHTML <pre class='brush: groovy'>">Groovy</a></li>
                <li><a data-edit="insertHTML <pre class='brush: js'>">JavaScript</a></li>
                <li><a data-edit="insertHTML <pre class='brush: java'>">Java</a></li>
                <li><a data-edit="insertHTML <pre class='brush: jfx'>">JavaFX</a></li>
                <li><a data-edit="insertHTML <pre class='brush: perl'>">Perl</a></li>
                <li><a data-edit="insertHTML <pre class='brush: php'>">PHP</a></li>
                <li><a data-edit="insertHTML <pre class='brush: plain'>">Plain Text</a></li>
                <li><a data-edit="insertHTML <pre class='brush: ps'>">PowerShell</a></li>
                <li><a data-edit="insertHTML <pre class='brush: py'>">Python</a></li>
                <li><a data-edit="insertHTML <pre class='brush: rails'>">Ruby</a></li>
                <li><a data-edit="insertHTML <pre class='brush: scala'>">Scala</a></li>
                <li><a data-edit="insertHTML <pre class='brush: sql'>">SQL</a></li>
                <li><a data-edit="insertHTML <pre class='brush: vb'>">Visual Basic</a></li>
                <li><a data-edit="insertHTML <pre class='brush: xml'>">XML</a></li>
Feb 1, 2014 at 11:01 PM
Edited Feb 2, 2014 at 1:04 AM
rtur wrote:
You should be able to switch to source vie in editor and add snippet like this:
<pre class="brush: c-sharp;">// example.cs
function foo()
    var bar = 1;
is there any way to refresh or restore the syntax highlighting files? My code looks same as this but it doesn't highlight. Just renders as regular text

Edit: Alright finally fixed my problem. Downloaded the original file pack from and unzipped it to my site root. Then from BE2.9 "Dashboard>Settings>Custom code" page added the code below to HTML head part. Probably it's not the most excellent way of usage but it finally did work for me.
<script type="text/javascript" src="root/syntaxhighlighter/scripts/shCore.js"></script>
<script type="text/javascript" src="root/syntaxhighlighter/scripts/shBrushCSharp.js"></script>
<link type="text/css" rel="stylesheet" href="root/syntaxhighlighter/styles/shCoreDefault.css"/>
<script type="text/javascript">SyntaxHighlighter.all();</script>
Feb 2, 2014 at 2:38 AM
I haven't had any time to explore an further as of yet. I was curious as to why I didn't have any issues when I updated to BE2.9 after reading your abbve post. I went to my site.master page and found the below. I had forgotten I had add this to the HTML head of the document.
<link href='<%# Page.ResolveUrl("~/editors/tiny_mce_3_5_8/plugins/syntaxhighlighter/styles/shCore.css") %>' rel="stylesheet" />
    <link href='<%# Page.ResolveUrl("~/editors/tiny_mce_3_5_8/plugins/syntaxhighlighter/styles/shThemeDefault.css") %>' rel="stylesheet" />
    <script type="text/javascript" src="<%# ShRoot %>scripts/XRegExp.js"></script>
    <script type="text/javascript" src="<%# ShRoot %>scripts/shCore.js"></script>
    <script type="text/javascript" src="<%# ShRoot %>scripts/shAutoloader.js"></script>
    <script type="text/javascript" src="<%# ShRoot %>shActivator.js"></script>