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/4/2010 1:40:15 PM

cigar accessories store

Thanks for writing this. I really feel as though I know so much more about this than I did before. Your blog really brought some things to light that I never would have thought about before reading it. You should continue this, Im sure most people would agree youve got a gift.

cigar accessories store us

9/4/2010 3:25:18 PM

leather jackets

Leather jackets are now available in a good range of colours and sizes to suit everyone who likes a leather jacket. 100% leather jackets feel and look fab and dont really need to cost the earth... I know where I'm going for my next leather jacket.

leather jackets us

9/4/2010 4:37:34 PM

Geoffrey Devon

This is unbelievable. I am a greenie in this whole marketingthing and the best website I found to make money is Facebook Traffic Ninja

Geoffrey Devon us

9/4/2010 5:43:54 PM

Web Zaragoza

Pretty insightful post. Never thought that it was this simple after all. I had spent a good deal of my time looking for someone to explain this subject clearly and you’re the only one that ever did that. Kudos to you! Keep it up

Web Zaragoza es

9/4/2010 6:40:27 PM

Sweepstakes

Particular thanks are due for this article. I now have got 3 enquiries for you: 1. Do you already have any form of Really simple syndication feed? 2. Getting this done in reality took me various tries to submit this comment considering that I continued getting to /wp-comment.php, so why did that happen? 3. Why does your title BlogEngine.NET - Plain Text Post Editor have so many ------ (dashes) in it. I'm using Netscape. Possibly thats the trouble? Once More, many thanks!

Sweepstakes us

9/4/2010 7:24:43 PM

Merle Penticoff

Well I can see by the number of comments that people are fairly upset. Running a blog is difficult because people won't always agree, but that's what makes it so much fun.

Merle Penticoff us

9/4/2010 8:58:17 PM

satellite tv for pc

I don’t agree with most people here; since I started reading this blog post I couldn't stop until , although it wasn't just what I had been trying to find, was indeed a fantastic read though. I will instantaneously grab your RSS feed to keep informed of future updates.

satellite tv for pc us

9/4/2010 10:37:09 PM

sidi cycling shoes

Thanks for this site. We all love to save a dollar and your advice helps

sidi cycling shoes us

Add comment


(Will show your Gravatar icon)  

  Country flag

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



Live preview

9/4/2010 11:19:30 PM

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