text editor

Discussion on general framework issues.

Moderators: ckosloff, DerManoMann

text editor

Postby DerManoMann » Mon Jan 18, 2010 1:25 am

With the potential re-implementation of the ez page admin UI I've also started looking into WYSIWYG editors (again). The current zen cart API is not very flexible, IMHO, so I think I might look at using either the ZenMagick widget API for this (there's already a textarea widget) and/or plugins.

I suspect the wraper will be a widget and the whole packaged as plugin - makes sense, right?

Now I am looking at potential candidates and it seems htmlArea, TinyMCE and CKEditor are the most obvious choices. I guess if those three work everything should be possible :)

As a side effect, it should then be possible to easily allow those editors in storefront code as well (if needed).

Again, comments and suggestions welcome.
DerManoMann
Founder
 
Posts: 305
Joined: Wed Oct 21, 2009 8:52 pm
Location: New Zealand

Re: text editor

Postby ckosloff » Mon Jan 18, 2010 5:32 am

I have had bad experiences with WYSIWYG editors in Zen Cart and removed them all.
First, they input extraneous characters in the code which are not always properly rendered in the browsers.
Also, inserting images with them throws errors as they load images in their own particular images folder, which not always reflects the structure of the site.
http://www.zen-cart.com/forum/showpost. ... tcount=245
I would not bother much with those.
Besides, for ezpages you can easily craft a page in any html editor and upload.
If you are making $ out of ZenMagick, please consider a monthly contribution.
Don't strangle the hen that gives golden eggs.
To give back to the project is not generosity, just sound business practice.
User avatar
ckosloff
Soup Nazi
 
Posts: 176
Joined: Mon Oct 19, 2009 4:05 am
Location: South Florida

Re: text editor

Postby lankeeyankee » Mon Jan 18, 2010 5:26 pm

I feel that we need to have something in ZM to be able to have it as a "complete" package so one doesn't have to use 3rd party software to do a task for the site that should be able to be done within the ZM interface. I have just checked the source for several pages in my site that are EZ Pages and Defined Pages, made with FCKEditor, and I don't see extraneous characters, but they are fairly simple pages without images so perhaps I am not seeing the full issue. Isn't there a way to configure the editors to specify an image directory so it can go with the other images?
lankeeyankee
Beginner
 
Posts: 27
Joined: Sun Nov 29, 2009 11:52 pm

Re: text editor

Postby ckosloff » Mon Jan 18, 2010 5:30 pm

I don't know.
From your point of view, it is commendable that you want to release ZM as a complete package.
I cannot help you much there, because the moment I started to have trouble with the WYSIWYG editors I uninstalled them all, and that was a long time ago.
If you are making $ out of ZenMagick, please consider a monthly contribution.
Don't strangle the hen that gives golden eggs.
To give back to the project is not generosity, just sound business practice.
User avatar
ckosloff
Soup Nazi
 
Posts: 176
Joined: Mon Oct 19, 2009 4:05 am
Location: South Florida

Re: text editor

Postby lankeeyankee » Mon Jan 18, 2010 5:32 pm

Xinha looks to be another good potential wysiwyg editor, I tried it but the port to zen cart wasn't quite complete and the person doing it was out of her depth and never got any help in the forum. I am sure that an experienced developer could do it easily. It works with Firefox, which was an issue with FCKEditor if I am remembering correctly - images and links were a pain to add in Firefox and I would have to use IE to do the pages.
lankeeyankee
Beginner
 
Posts: 27
Joined: Sun Nov 29, 2009 11:52 pm

Re: text editor

Postby ckosloff » Mon Jan 18, 2010 6:13 pm

I just took a look into the zc-base from github and FCK is not there, just HTMLarea.
I am trying to test it, but it does not register, in other words I always see plain text.
This is a problem that I noticed before on Zen Cart, it takes reloads until it finally registers.
Just checked the Xinha home page, looks like that is configurable.
That editor warrants more investigation as to how to port it to ZM.
If you are making $ out of ZenMagick, please consider a monthly contribution.
Don't strangle the hen that gives golden eggs.
To give back to the project is not generosity, just sound business practice.
User avatar
ckosloff
Soup Nazi
 
Posts: 176
Joined: Mon Oct 19, 2009 4:05 am
Location: South Florida

Re: text editor

Postby Dayo » Mon Jan 18, 2010 8:21 pm

I must be old school as I don't like the WYSIWYG editors and prefer to input html directly.
Dayo
Beginner
 
Posts: 8
Joined: Wed Nov 11, 2009 6:47 pm

Re: text editor

Postby ckosloff » Mon Jan 18, 2010 8:49 pm

Same here, but bear in mind that Mano has a different viewpoint.
He has to release a complete distro, and take into account users who will want to use a WYSIWIG editor.
If you are making $ out of ZenMagick, please consider a monthly contribution.
Don't strangle the hen that gives golden eggs.
To give back to the project is not generosity, just sound business practice.
User avatar
ckosloff
Soup Nazi
 
Posts: 176
Joined: Mon Oct 19, 2009 4:05 am
Location: South Florida

Re: text editor

Postby DerManoMann » Tue Jan 19, 2010 2:03 am

I've been playing with CKEditor and TinyMCE and got both *working* via widget class (extending ZMTextareaFormWidget). That means both display and follow the basic attributes like with/height/rows/cols/initial value.

Seeing that there is soooo much that can be customized, I'd like to have three settings for editors: 'basic', 'advanced', 'expert' with more and more options/toolbars/etc.

Also, it would be nice to support the save button, but that can wait, I guess. There is also an issue with TinyMCE getting confused if the JS is minified...

htmlArea seems to be purely commercial, unless I've been to the wrong website. For the exercise of getting some API together I think I'll stick with the two I've got right now.

@carlos: The editor does work, but there is no clean way to integrate. Have you tried the ZenMagick Static Page editor? That should offer you to toggle between plain and HTMLArea.

EDIT: Oops - there might be a bug in the editor, actually :/
EDIT2: Hehe, I should test before writing, I guess as there are two bugs. The main form needs an addition hidden field main_page=static_page_editor, but even then the the editor does not work. More reason to get this working properly :)
DerManoMann
Founder
 
Posts: 305
Joined: Wed Oct 21, 2009 8:52 pm
Location: New Zealand

Re: text editor

Postby ckosloff » Tue Jan 19, 2010 2:59 am

Well, I could try that editor for testing purposes.
Frankly, wouldn't use it for writing, but that's me, others might.
More importantly, minify seems to "confuse" several javascripts.
I tried the one included in Ajax Checkout (for Zen Cart) and it messed up jscript_imagehandler and another javascript I use for enlarging attribute images.
Please be careful with that one.
But that is the matter of a different thread.
If you are making $ out of ZenMagick, please consider a monthly contribution.
Don't strangle the hen that gives golden eggs.
To give back to the project is not generosity, just sound business practice.
User avatar
ckosloff
Soup Nazi
 
Posts: 176
Joined: Mon Oct 19, 2009 4:05 am
Location: South Florida

Re: text editor

Postby DerManoMann » Tue Jan 19, 2010 4:06 am

Don't worry right now. There is actually a lot more broken in the static page editor that I thought :oops: On the bright side, I've just finished converting the static page editor to use the new editor plugin system and both editors work!
No file edits, no nothing. Only thing that one may want to do is set a default editor class via local.php, otherwise the currently selected one (or session one) is used.
DerManoMann
Founder
 
Posts: 305
Joined: Wed Oct 21, 2009 8:52 pm
Location: New Zealand


Return to Framework

Who is online

Users browsing this forum: No registered users and 1 guest

cron