BlogEngine.NET - Plain Text Post Editor

by nathanrossi 7/2/2008 2:04:00 PM

The TinyMCE BlogEngine.NET Post Editor cant be a pain sometimes, as can all WYSIWYG editors. So if you’re good with HTML or just want to use a plain text then this is how you do it.

I wrote this tutorial because when I wanted to swap out the editor with just a text box I couldn’t find a tutorial.

What is explained here is how to swap the TinyMCE editor with a standard Text Area. First off you need to have BlogEngine installed. Then we look to replace the TinyMCE container with a standard multi line Text Area.

Open up the file “\admin\Pages\Add_entry.aspx” and find the line.

<Blog:TextEditor runat="server" id="txtContent" TabIndex="4" /></p>

<!-- And replace it with -->

<p><!-- Change the Width/Height to what ever suites you -->
<asp:TextBox runat="Server" ID="txtContent" Width="100%" Height="400px" TextMode="multiLine" />
Now to make the Auto Save work you must replace the line
var content = tinyMCE.getContent(&#8216;mce<em>editor</em>0&#8217;);</p>

<p>// With</p>

<p>var content = document.getElementById(&#8216;&lt;%=txtContent.ClientID %>&#8217;).value;
Also remove the Reference to the htmlEditor, cause its not needed anymore
&lt;%@ Register Src=&#8221;../htmlEditor.ascx&#8221; TagPrefix=&#8221;Blog&#8221; TagName=&#8221;TextEditor&#8221; %>

Now when you run it, you might notice that when u press enter in the Text Area it will Post Back, to prevent it posting we must edit the “\admin\Pages\Add_entry.aspx.cs”. Find this line.

if (!Utils.IsMono) Page.Form.DefaultButton = btnSave.UniqueID;</p>

<p>// And comment it out.</p>

<p>//if (!Utils.IsMono) Page.Form.DefaultButton = btnSave.UniqueID;

Save the files, and try out Plain Text Editor. To make it simpler you can just download the files and extract them into the “\admin\Pages\” and replace the existing files.

Download

If you don’t want to use HTML at all, you can try out other formatting extensions like the Markdown Formatter or a BBCode formatter.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: , , ,

BlogEngine.NET

Welcome to My Blog

by nathanrossi 6/29/2008 4:44:00 PM

Welcome,

This is the first post on my newly created blog.

The run down of what i will be posting on my blog

  • Projects i design and work on
  • Software i make
  • Fixes/Mods/Hacks i do
  • Random stuff

I will be posting another blog post soon!

My blog is using the ASP.NET blog BlogEngine.NET. Check it out if your going to make a blog.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: ,

General

Powered by BlogEngine.NET 1.3.1.0
Theme by Mads Kristensen Modified By Nathan Rossi
© Copyright 2012 Nathan Rossi