Jul 05, 2009, 01:17 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
Search via SMF or Google: modx forums all of modxcms.com web
  MODxCMS.com   Forums   Help Login Register  
News:Donate to MODx: Donations
Pages: [1]   Go Down
  Print  
Author Topic: [Patch/Mod] Editor Selection when editing a document  (Read 3004 times)
0 Members and 1 Guest are viewing this topic.
Bravado
Coding Team
*
Posts: 1,104


"I can learn to resist anything but temptation..."


WWW
« on: Mar 05, 2006, 01:07 PM »

Ok...this is a bit of a sneak peek on a feature that has been added for the next MODx release.  In a nutshell, I've had a few folks asking if there was a way to use a plain textarea instead of FCKEditor or TinyMCE when editing a document.  The answer?  Yes...but it would have required a bogus plugin...which doesn't make sense in this case.  So...instead, I opted to just add an option to allow selecting "None" under the System Configuration thus forcing the content area to display a plain textarea instead of an RTE.  Simple...and it works well!

Now that that's out of the way, another thing I thought would be nice is to allow switching between the different editors without having to visit the System Configuration page each time.  I ran into this problem while attempting to add a document that would act as a pure CSS content page...which can be a bitch to edit without FCKEditor and TinyMCE screwing up the code!  So, what I thought would be nice is to have a simple dropdown menu that allows you to select the editor you want to use: None, FCKEditor, or any other editor that has been added in (TinyMCE, Xinha).  This way, if I edit a document that just has pure CSS code in it, I can switch to 'None' and safely edit my document knowing that FCKEditor isn't going to screw it up.  Works great and I'm happy!  The dropdown was added just below the main content editor like so:



Attached is a zip file of the three files that have changes to them.  These are based off of the default files in version 0.9.1 so if you've made changes to these file make sure and run a comparison check against them.  These files will go in your /manager/actions/dynamic directory.  I've tested the code in Firefox and IE 6 on XP and feel pretty confident that it'll work nicely on the Mac and Linux as well.  Let me know if you find a problem with it.

Aside from these changes, I'm also planning to change the way the Template and Chunk editing works.  I don't see any reason why we couldn't implement similar functionality in these sections.  I'll be experimenting with the code here and if all goes well I'll submit my changes for the next version very soon.  Smiley

Have fun! 

Jeff

* MODx-0.9.1_editor_selection_patch.zip (28.73 KB - downloaded 298 times.)

* modx_editor_selection.png (3.11 KB, 291x150 - viewed 603 times.)
« Last Edit: Mar 05, 2006, 01:11 PM by Bravado » Logged

Jeff Whitfield

"When someone asks you, A penny for your thoughts, and you put your two cents in, what happens to the other penny?"

-George Carlin
sottwell
Documentation Team
*
Posts: 8,837



WWW
« Reply #1 on: Mar 05, 2006, 01:38 PM »

Um...scratches head...Can't you just un-set the Rich Text checkbox in the Page Settings tab of a document?  And click No in the system configuration?  I think I'm missing something here.

What would be useful is to have the Resource Browser available even if the RTE isn't.

I also found useful the patch that allows an individual user to be set to use None as well as which editor to use.
Logged

sottwell.com has moved to a lovely Solaris 10 server!
Log in username guest, password guestuser.
Templates are now becoming available at http://sottwell.com/templates.html
rthrash
Foundation
*
Posts: 10,471



WWW
« Reply #2 on: Mar 05, 2006, 02:13 PM »

This is really awesome as it allows you to set different editors for different docs in the same in stall. Sweet. I can see instances where FCK would be preferable, and others where Tiny would work, and (most) others where a plain text would be my preference. Killer job!
Logged

MODx is a framework that allows web professionals to turn over sites to end-users for daily maintenance without worrying. Community participation and questions are encouraged, especially when you help us help you, read the wiki, and review snippet parameters – even if you have to look at the source. Searching the forums helps, too.
Ryan Thrash
MODx Co-Founder
Principal @ Collabpad
work productively.
work intelligently.
work together.
Bravado
Coding Team
*
Posts: 1,104


"I can learn to resist anything but temptation..."


WWW
« Reply #3 on: Mar 05, 2006, 03:48 PM »

This is really awesome as it allows you to set different editors for different docs in the same in stall. Sweet. I can see instances where FCK would be preferable, and others where Tiny would work, and (most) others where a plain text would be my preference. Killer job!

The editor preference isn't actually saved with the document...however though, I'm sure that could easily be changed!  Wink  Definitely something to think about!  Cheesy
Logged

Jeff Whitfield

"When someone asks you, A penny for your thoughts, and you put your two cents in, what happens to the other penny?"

-George Carlin
Bravado
Coding Team
*
Posts: 1,104


"I can learn to resist anything but temptation..."


WWW
« Reply #4 on: Mar 06, 2006, 07:29 AM »

Another thing that was brought up is the ability to set permissions on a per-user basis on which editors are available for use.  If you add a per-page /per-document setting then it's probably necessary to implement a different approach to per-user and global settings for the editors.  Need to brain-storm this...and quick!  LOL!
Logged

Jeff Whitfield

"When someone asks you, A penny for your thoughts, and you put your two cents in, what happens to the other penny?"

-George Carlin
Djamoer
Emeritus
******
Posts: 1,495

No one can limit a man other than the man himself.


WWW
« Reply #5 on: Mar 06, 2006, 09:08 AM »

Another thing that was brought up is the ability to set permissions on a per-user basis on which editors are available for use.  If you add a per-page /per-document setting then it's probably necessary to implement a different approach to per-user and global settings for the editors.  Need to brain-storm this...and quick!  LOL!

In fact we spell it ja-son Wink

Anyway, I think the format does need to be a commonly used format. I like the idea of xml, but I also like the idea of having other text format.
I think suggestion or comment will be awesome.

Sincerely,

NOTE:  Shocked I think I post on the wrong topic. It's suppose to response Jason's response on Json Embarrassed
« Last Edit: Mar 06, 2006, 03:47 PM by Djamoer » Logged

chanh
Guest
« Reply #6 on: Mar 06, 2006, 03:42 PM »

Another thing that was brought up is the ability to set permissions on a per-user basis on which editors are available for use.  If you add a per-page /per-document setting then it's probably necessary to implement a different approach to per-user and global settings for the editors.  Need to brain-storm this...and quick!  LOL!

Jeff, (updated after Wendy point it out)

To have this feature that you just sighted it would be really nice!

I tried out your patch it works very nicely!  Well done!
« Last Edit: Mar 06, 2006, 04:26 PM by chanh » Logged
Djamoer
Emeritus
******
Posts: 1,495

No one can limit a man other than the man himself.


WWW
« Reply #7 on: Mar 06, 2006, 03:48 PM »

Jason,

To have this feature that you just sighted it would be really nice!

I tried out your patch it works very nicely!  Well done!

I think it's suppose to be Jeff, not Jason. Sorry for my previous post Grin
Logged

Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP

Copyright © 2005-2008 MODxCMS, All rights reserved. Contact Us
Styles by ziworks.com

Powered by SMF | SMF © 2006-2008, Simple Machines LLC

Valid XHTML 1.0! Valid CSS!