WYSIWYG - tiny_mce for admin

As right now there is no WYSIWYG editor in admin, I started to write a module adding GPL Tiny_MCE to textareas in shop admin.

Right now its only Version 0.1 and it only adds Tiny_MCE to Article longtext, CMS entries, and category longtext, but I’ll extend it in the next days and I’ll hope community will also contribute something :slight_smile:

File and more infos on my blog :

http://www.musterdenker.de/2008/10/tiny_mce-for-oxid-eshop/

Hi MaFi,

installed it and it works pretty nice for me. Good job!
BTW: I love TinyMCE :wink:

Marco

alright marvin,

I guess found the readme.txt in the module and did steps 1 and 2.

“register the module in admin:” means go to your admin area -> master settings -> core settings -> system -> modules and enter

article_main => tinymce/tinymce_article_main
category_text => tinymce/tinymce_category_text
content_main => tinymce/tinymce_content_main

Cheers
Marco

Hi,

it shall look like this


in FF3. In Internet Explorer and in Opera unfortunately it is not initialized.

No idea why it doesn’t work for your FF… Maybe down- or upload probs and you destroyed a file or something?

regards

Hi Marvin,

yes I am :smiley:
Opera, unfortunately does not work with any WYSIWYG-Editor that I know.
As I wrote, I dont get TinyMCE working with IE7 as well. What is interesting: With other CMSses, let’s say CMSimple, TinyMCE even works with IE7. Maybe different built in versions, probs with the frame work?
fitteur, maybe you can tell us something about that?

Marco

Thanks to your hints I found the problem and solved it :slight_smile:
It was 1 small comma :frowning:
Have a look on my blog and you’ll find version 0.1.1 (http://www.musterdenker.de/2008/10/tiny_mce-for-oxid-eshop/)
But why using IE7 anyhow :stuck_out_tongue:

Have a nice weekend…

Thanks alot mate!

Thats the drawback tiny_mce can’t deal with smarty tags and I don’t know a WYSIWYG editor under GPL or similar licence which is smarty compatible … anyone has any ideas ?

Hmm tiny_mce is open source why not teach it to deal with Smarty Tags … anyone good in JS and willing to do it?

Maybe I’ll give it a try next week.

IMHO, there’s no 3dr party WYSIWYG-Editor able to properly handle smarty tags yet except WYSIWYGpro whose license is not keen to be used with open source software.


Marco Steinhäuser
Community Operator
OXID eSales AG

Hello I uploaded a new version of that module basically including the changes suggested by Robert Hinn. Thanks a lot :slight_smile: You also mentioned that you made some JS changes to the tinymce ? Would you like to contribute them as well ?Tiny_mce V 0.2
This version (0.2) works with CE 4.0.0.1 and saves changes of text as well as changes in text formating. I still could not reproduce the mentioned problems on my maschine :frowning:
So any suggestions are welcome…

Thanks for feed back!


Marco Steinhäuser
Community Guide
OXID eSales AG
http://twitter.com/marcosteinhaeus

Hey, cool! :slight_smile:

Did you determine any collisions with the smarty yet?

Best


Marco Steinhäuser
Community Guide
OXID eSales AG
http://twitter.com/marcosteinhaeus

hey fitteur,

i´ve installed the editor, but nothing happened, i don´t see any editor.
i´ve just a textarea box…
do i have to say oxid CE, that i want to use a editor? i don´t find anything in the config-settings…

i hope you can help me :slight_smile:

hey marco,
thanks for the answer.

i have done this steps before, but nothings happens…

i have copy the tinymce folder to root/modules, the headitem.tpl to root/out/admin/tpl
then i´ve copy the three lines from the module
article_main => tinymce/tinymce_article_main
category_text => tinymce/tinymce_category_text
content_main => tinymce/tinymce_content_main

now, the following text stands in the textarea

oxorder => invoicepdf/myorder
article_main => tinymce/tinymce_article_main
category_text => tinymce/tinymce_category_text
content_main => tinymce/tinymce_content_main

but nothing happens, no javascript error or somethin else…
with right click -> sourcecode i can see, that the javascript is loading right, the javascript file is on the right place etc.

(< s c r i p t t y p e = " t e x t / j a v a s c r i p t " s r c = " . . / m o d u l e s / t i n y m c e / t i n y _ m c e / t i n y _ m c e . j s " > < / s c r i p t > )
(without spaces, the spaces are just to write this code in this forum)
i can see the function also.
t i n y M C E . i n i t ( {…

hmmm, i will test a little bit, if i have the answer for this problem, i will write this down in this topic.
it would be great if you have an answer for me :wink:

all the best
marvin

so, i have test a little bit and installed oxid on my server, before i have worked just with my xampp under localhost…

now it works with firefox, with internet explorer 7 i have a javascript error.

it seems that no css file is loaded.
here is a link to imageshack with a screenshot, how it looks now with firefox…img136.imageshack.us/my.php

is this right, when it looks so?
i cant see where the editor begin or end?

all the best

hey marco,
wow, thats right, i´ve downloaded it a second time, tested it under localhost (no uploading problems…) and now it works, i´ve uploaded it on the server and the same, it worked.
but…
just with firefox, not with ie7 or 6…
An error has occurred in the script on this page
Error: Bezeichner, Zeichenfolge oder Zahl erwartet ( i think you are german ;D)
URL: http://domain/admin/index.php?cl=article_main&oxid=-1

my problem is, that this error message say nothing to me… :wink:

There’s another problem:
tiny_mce messes up some smarty tags in longtexts or cms-stuff. :frowning:
For example [{$shop->imagedir}] cannot be used, neither [{$shop->selflink}] can … because the “>” ist converted to html-entitiy.

This screws up the whole page-design in some cases.

mfg
urban

Andreas Ziethen - Geschäftsführeranzido GmbH - ecommerce in guten händen!
Programmierung - Schulungen - Performanceoptimierung

First of all, a very nice work!

I think that this will work for everyone who will install this shop for a customer who is allowed to add articles, but for professionals who want to use smarty tags in their texts this won’t be a propper solution. I cannot remember a WYSIWYG editor who is able to handle smarty tags :confused:

Most of them are WYSINWYGBWYW (What You See Is Not What You Get But What You Want)

Best regards,dklein (mail me)TimeLine® eBusiness

Hello,

I put together some javascript code to replace the html entities within smarty tags. Another thing, though: I noticed that you renamed the original copyLongDesc() function and never call it in your new one, no matter whether TinyMCE is used as the editor or not (through the modules). This is bound to cause some problems, e.g. I wasn’t able to edit newsletter text in html anymore (the content would always be deleted instead of saved :wink: ). I’ve also included a fix for that by calling the original code if TinyMCE isn’t active for that view.

I’ve put up the modified out/admin/tpl/headitem.tpl on our webserver: headitem.tpl
The string replacements could probably be done by a single regular expression, but I didn’t have the time to fight with the regexp syntax :wink:

By the way, you don’t need three different modules, you can use one of them for all the admin views where you want to include TinyMCE (the code is the same anyway, only the class names differ…). I renamed one of the modules to tinymce.php (and the class to tinyMCE) and used the following in the modules configuration:

 article_main =&gt; tinymce/tinymce
 category_text =&gt; tinymce/tinymce
 content_main =&gt; tinymce/tinymce
 newsletter_main =&gt; tinymce/tinymce 

Cheers,
Robert