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

Related posts

Comments

8/15/2008 12:36:02 AM

hanei

i want to fix the post Editor.
Press Enter to <br> not <p>,how to do?

hanei cn

8/24/2008 8:14:21 AM

nathanrossi

Not sure you would have to look through the TinyMCE code in order to do that. If you are using TinyMCE as the editor.

nathanrossi us

11/27/2008 3:36:17 AM

Busby SEO Test

need more tags can help me please!!

Busby SEO Test us

9/8/2010 2:20:34 AM

search engine optimization

Sweet.... This is what I'm looking for... Thanks for sharing ;)

search engine optimization in

9/8/2010 2:29:19 AM

computer repair

great post thanks for sharing i like this blog and will add it to my favorites. Thanks again

computer repair us

9/8/2010 2:50:28 AM

payday loan interest

And, you look for a loan which can provide you fast cash. Money provisions though take a little time before managing financial affairs. In this prospect, no credit check payday loans can offer you fund immediately.

payday loan interest mt

9/8/2010 3:04:58 AM

Hank Mcfarren

Militarily speaking, what 142,000 troops can do but 140,000 troops cannot?

Hank Mcfarren us

Add comment


(Will show your Gravatar icon)  

  Country flag

[b][/b] - [i][/i] - [u][/u]- [quote][/quote]



Live preview

9/8/2010 3:46:11 AM

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