A blog about .NET, Graffiti, Community Server, and Kevin's life

Community Server XStandard Wrapper

In my last post I showed how configure Community Server to use a plain textbox instead of FreeTextBox as it's default text editor. I decided to do further research on text editor replacements and look for other free text editor controls that produce better html code and are less annoying than FTB. I was actually looking for a web control that is like a mini HomeSite (the classic html editor from Allaire/MacroMedia/Adobe), which has long been my HTML editor of choice since I prefer to type my blog posts in source view. I didn't find what I was looking for but I did find several other free WYSIWYG editor controls and one in particular caught my eye.

XStandard is a WYSIWYG html editor that can be used in a browser or a client application. The cool thing about XStandard is that it doesn't use the quirky MS IE HTML4 dll to generate the source like most other free editors. XStandard was written from scratch as a standards compliant, valid XHTML-producing editor. This means it produces much cleaner code than FreeTextBox does and won't mangle your hand-typed code nearly as much when you switch to design mode and back. It has a free "lite" version and a commercial "pro" version with many spiffy features. The only drawback to using XStandard is that it is not a pure JavaScript solution. It requires an ActiveX object (for IE) or plugin (for FireFox) to be installed before you can use it. You can download the free lite version from xstandard.com. It also is supposed to have a feature where it will automatically try to install if the ActiveX/plugin doesn't already exist on your browser, although I have not tested that part yet. This means that while it may be a great solution for someone just running CS Blogs and Gallery like me, it may not be practical if you are running CS Forums with a large user base, as that would require each user to install the control in order to post a forum message.

Community Server uses a provider model that allows users to easily change which text editor they want to use, as long as there is an appropriate wrapper for it that implements the ITextEditor interface. So I wrote a Community Server wrapper for the XStandard text editor control. It is very simple to change a CS installation to use the XStandard control rather than FreeTextBox. You just need to copy the wrapper .dll file to your bin directory and change one line in the communityserver.config file. You can download a zip file containing detailed instructions, the .dll, and the source code on my Community Server Development Page.

This is version 1.0 of the wrapper, and so far I have only tested it on my web site. If you run into any problems or have questions please contact me. In the future, I would like to modify the CS source to allow each application (blog, gallery, etc.) to be able to specify what text editor they wish to use rather than it being a global setting.

» Similar Posts

  1. How to use the XStandard editor in CS 2007
  2. Live Blogging the CSDC - Part 3
  3. Announcing the DotText-CS-Converter tool

» Trackbacks & Pingbacks

  1. Community Server allows users to select what editor they would like to use for writing/editing posts

    Kevin Harder — August 13, 2007 6:58 PM

» Comments

  1. Craig avatar

    Hi Kevin.



    Thanks for your two posts regarding FreeTextBox and XStandard. Most excellent, and with the problems many people (including myself) are having with the standard FreeTextBox - this is a welcome post.



    However - i was wondering. FreeTextBox in CS 1.0 is not in a suitable condition to put in production. Most of the environments i'd like to install this wouldn't require any kind of fancy editing in posts.



    When i implement the DefaultTextEditor in CS - it's almost perfect, however it doesn't replace Char(13)'s with "<br>"'s. If it could do this - it'd almost be perfect as a plain text editor.



    I've attempted to look at your XStandard wrapper, but i'm a VB man - and certainly no pro as yet.



    Is it possible to see perhaps a modified wrapper for the DefaultTextEditor that replaces returns with "<br>"'s?



    I'm sure a fair bunch of people would be interested in this!



    In any case - WELL DONE! :D



    Regards,



    --Craig

    Craig — April 21, 2005 5:56 PM
  2. kevin avatar

    Craig,



    Thanks for your comments. I'm glad it was of use!



    Heh, I actually prefer VB.NET over C# as well, but C# isn't very hard to use once you start using it and get over having to type all those semicolons. =)



    Creating a modified DefaultTextEditor wrapper that supports <br>'s should be pretty easy. I'll try to throw one together in the next couple days and post on this blog. Thanks for the idea!

    kevin — April 21, 2005 6:08 PM
  3. jayson knight avatar

    2 questions: does it mangle code C&P from vs/word, and is it *full* supported by firefox? I don't use CS for most posts (BlogJet), but I do use it to tidy up any code I include in posts; FTB does an incredibly horrible job w/ code formatting (as I'm sure you know).



    Good find; if the answers to both of those are yes, I'll be updating CS to use it.

    jayson knight — April 21, 2005 6:38 PM
  4. kevin avatar

    Jayson,


    It is fully supported by FireFox. I tested it in both when I was working on the wrapper, and I usually use FireFox when working with my site. Also, since the people who wrote that control are big web standards and xhtml proponents, I imagine they don't use IE either. =)



    I'm not sure about Word since I haven't used it to markup source in the past. I just tried pasting some text from word doc as a test and it seemed to strip out all of the word formatting and put it as plain text. On the XStandard web site they mention MS Word support as a "pro" feature. I would try it out and see if it annoys you or not. You can always switch back to FTB or the plain textbox easily. Cheers

    kevin — April 22, 2005 10:27 AM
  5. Scott avatar

    It is a really cool wrapper. I installed it locally and love it.



    I am thinking a 1.2 feature will be a user selectable/configurable editor.



    -Scott

    Scott — April 23, 2005 4:44 PM

Comments are closed