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

2/5/2012 2:11:29 PM

roofing contractor valley nebraska

I think youve made some truly interesting points. Not too many people would actually think about this the way you just did. Im really impressed that theres so much about this subject thats been uncovered and you did it so well, with so much class. Good one you, man! Really great stuff here.

roofing contractor valley nebraska us

2/6/2012 12:20:28 AM

paddington massage London

Every time I see a really good article I do a few things:1.Share it with all the relevant friends.2.save it in all of the favorite social sharing sites.3.Make sure to return to the blog where I read the post.After reading this post I am seriously concidering doing all 3!

paddington massage London

2/6/2012 2:24:26 AM

Body Balance

What I dont understand is how youre not even more popular than you are now. Youre just so intelligent. You know so much about this subject, made me think about it from so many different angles. Its like people arent interested unless it has something to do with Lady Gaga! Your stuffs great. Keep it up!

Body Balance us

Add comment


(Will show your Gravatar icon)  

  Country flag

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



Live preview

2/6/2012 9:09:49 AM

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