TinyMce Adapter for EPiServer CMS

by: Jacob Khan

The EPiServer CMS editor is a great editor. It is easy to use, simple yet gives you all the complicated features it should. The only issue is that it doesn’t work for non IE browsers. I know that the dev team is working hard on a solution for r3 but until then I was asked to create a tinymce plug-in for EPiServer CMS. There already exists a plug-in for the FCK Editor made by Johan Olofsson which works great. This module uses the same technology but with some extra features.

TinyMCE is a platform independent web based Javascript HTML WYSIWYG editor control released as Open Source under LGPL by Moxiecode Systems AB. There exists a .Net wrapper, a PHP wrapper but in this plug-in we used the javascript package of TinyMCE. The editor is easy to use and even easier to configure for your needs. I first used it for WikiX and it was love at first sight. The plug-in has been tested on FireFox 3.0.6 in XP and on Safari, Firefox 3 on MAC OS X and Chrome in Vista.

Here are some of the features with this implementation:

  • Insert links and images from EPiServer showing the file manager and the tree
  • It includes a function for search and replace
  • Insert objects such as flash movies, QuickTime, vm…
  • Full Screen editing
  • Honors property settings (e.g. dont show font)
  • Honors editor.css

This implementation includes around 20 options. You can easily add your own by adding a few lines in the javascript file. Unfortunately this means that the settings are not honored. In the Download package I include a javascript file with all the features available. All you need to do is change the name of the simple one and the advanced one.

Simple one that insetlink.js includes

simplededitor

Advanced one with no honoring advanced,js

advancededitor

 

The most interesting buttons on the editor are the insert link and insert image

insertimage 

These buttons have the integration with EPiServer CMS. When you click to add an image or media you get a simple image editor with a small button to browse the server. This opens the EPiServer Filemanager. Select an image or media and then you can use the simple TinyMce Editor to change the image size, etc.

tinymceditor2

 

When you want to add a link you click the insert link button and the same browse button appears but now you are redirected to the cms tree. Here you select a link and simply add it.

This is released on EPiCode so go ahead and download. The installation details are also on epicode

Enjoy

20 February 2009

Tags:


    Comments

    1. I don't really agree that the only problem with the standard editor is that it doesn't work with any browsers but IE, but Tiny is totally sweet. I started a similar project but I haven't had the time to finish it. The only thing this is missing is the dynamic content tool. I'll have to look into that.
    2. Excellent news, Jacob! Will try this out soon!
    3. Well done! This will make a lot of people very (!) happy.
    4. Great stuff! Looking forward to testing it!
    5. FCKEditor is really big and I'm looking forward to try this out with tinyMCE.
    6. Isn't ApplyEditChanges() missing in the code? My implementation can't save the data from the editor...
    7. Perhaps there is som breaking changes in R2 SP1 because I had to make som updates in the code. Now the ApplyEditChanges() is working and som other small adjustments. Can I share the code somewhere?
    8. I submitted the wrong code to the project. Just updated it. But please feel free to add your own contributions. https://www.coderesort.com/p/epicode/wiki/HowToContribute
    9. Thanks! Just missing one more thing to try this in production: PageFiles. The pagebrowser doesn't show Pagefiles. Any idea how to get it shown?
    10. Is it possible to remove specific tags from content pasted from MS Word? In our implementation we want the editor to keep simple formatting like bold, italic, underline but the ability to remove font, mso-objects and so on.
    11. Hi there! I had some trouble with the adapter on pages with several editors and different toolbar settings. All editors where using the same settings. Another problem was that no toolbar was showing up at all if "ALL" toolbar options where enabled. I have now posted new code for the Adapter on EPiCode as an attachment to the issue report. /René
    12. We need to find a plug-in for using episerver on a mac. There is no editor. Can someone give an advice?
    13. How do I do to implement it after I have downloaded all files on the server?
    14. Ann_sofie: You can use this or ruwen jins fck editor. I use firefox on my mac which i think works better than safari Daniel: Instructions on coderesort. https://www.coderesort.com/p/epicode/wiki/TinyMceAdapter/Download Good luck
    15. I have downloaded all files according to the instructions on coderesort. Then what to do?
    16. That should be all, nothing more is needed. Make sure that it is not caching the old settings. Also, check that the app_browser folder got the file added. There should only be one folder. Download the source code it is the latest with some bug fixes
    17. Do you have an example on how to implement tinymce as an editor on a public page in EPi. (Not in edit mode).
    18. Well sure, one is WikiX. Where we will soon do an update.
    19. I have followed the download instructions and everything looks ok but I cannot get this to work. Where should the whole TinyMCEAdapter folder be placed and is there any compiling or whatever that I need to do also? Right now this folder is just sitting there on the desktop, cannot be right huh? :) I just want to have it in the EPiServer edit mode instead of the standard editor. I'm using the latest cms version.
    20. It should not be on the desktop bot on the root of the site. i.e. C:/EPiServer/Sites/YourSite/TinyMCEAdapter.
    21. Yes, I thought so and tested that, however nothing happens, still same old editor in EPiServer. In the installation instructions it says "get the folder tinymce that contains langs, plugins, themes and utils folder and rename the tinymce folder to tiny_mce3211" In version 3.2.5 of the main package of tinymce the root folder is named "tinymce" and the langs, plugins, themes is under "tinymce\jscripts\tiny_mce" Correct me if I'm wrong, but it is this folder that should be renamed? And shall it still be "tiny_mce3211" for version 3.2.5 or something like "tiny_mce325"? Thanks for you help, I feel a bit stupid here :x
    22. I added some screenshots on coderesort showing how the file system should look. Wy it needs to be named tiny_mce3211 is because I actually look for that folder in the code. Even if the version of tiny is higher.
    23. Great effort with those screens, works perfectly now, Thanks! (FYI: I had the whole main package directly extracted to the TinyMCEAdapter folder, which incorrectly included the extra \jscripts\ level..)
    24. Has anyone looked at getting dynamic content to work yet?
    25. Any thoughts about implement Image Vault in TinyMCE?
    26. We have implmented this in a few projects where it works fine. Now we are trying to implement it in another project, but it doesn't work. We use excatly the same files and follow the same procedure, but it still doesn't work. We have tried to implemented it in 3 different projects, but none of them works. We have tested in these versions: Version=5.2.375.133 Version=5.2.375.236 Any idea? Thanks!
    27. Hi Christine, I would guess it is the tinymce files that have changed. Please email me information regarding what parts dont work. If you get a javascript error perhaps? jacob at episerver dot com
    28. We don't get any errors. And if we look at the html source it seems to be excatly the same as in the sites where it works fine. The editor become larger, so something happens. But it is still show html-code and icons are missing. We have tried to use the latest source code from coderesort, and the source code from another project where it works fine.
    29. That is very odd, I have not changed it for a while so I am guessing it is either tiny or episerver. how does the site structure look
    30. Change in advanced.js , in the function initialize tinymce.init function tinyMCE.init({ mode : "textareas", theme : "simple" }); this will simply do a very simple editor, another thing is to remember to check where the app_browsers file is located. I dont remember if it is called app_browsers or browser.
    31. This is the site in test http://leroy.reaktorutv.no. We added: App_Browsers/TinyEditPropertyDataControlAdapter.browser, bin/TinyMceAdapter.dll, bin/TinyMceAdapter.pdb and TinyMCEAdapter in root folder. Web.Config is changed to.
    32. Please email me a more detailed view of your folder structure
    33. Can you post your email please? Can't find it.
    34. jacob at episerver dot com
    35. This looks real nice but I can´t get the editor to show up by following the installation instructions. By comparing your screenshots with the actual content there seem to be a file missing named "showmanager.js" in the folder tiny_mce3211. Is this file no longer needed or could this be the source of the problem?
    36. Not sure, shouldnt be needed. Make sure the script is loaded by clicking view source of the frame. Check which version you are running. And first try installing it on say the public templates. otherwise email me your information and I can send a working tiny source. jacob ait...episerver(dot)come.
    37. I done as follow Jacob's instruction but nothing happen after that i built TinyMceAdapter project with PublicTemplate project and i have saw the following error message: Could not load file or assembly 'PresentationCore' or one of its dependencies. An attempt was made to load a program with an incorrect format.
    Post a comment    
    User verification Image for user verification  
    Jacob Khan

    About me

    I am a researcher at EPiServer based in Stockholm. I started working in the Research department in May 2008.
    I also blog on world.episerver.com
    See my profile card on world

     

    Syndications


    Archive


    Tag cloud

    EPiTrace logger