By bg1 on
I have just installed CKEditor. I haven't tried to do much because I can't even get the CKEditor display to left justify any text. The default is coming up center and clicking on the left justify button does not do anything.
Does one need to install WYSIWYG module at all if using CKEditor?
Any thoughts?
Comments
_
There are 2 modules to choose from to use ckeditor-- either http://drupal.org/project/wysiwyg or http://drupal.org/project/ckeditor. Choose one or the other, not both.
Also, i can verify that with ckeditor using the ckeditor module, the justify buttons work fine.
I have only ckeditor
I do not have module wysiwyg installed, only module ckeditor.
Thanks for any assistance.
I can confirm the problem.
I'm using the CKEditor 6.x-1.0-beta1 module with CKEditor 3.0.1.
I've come up with the solution
Firstly, i downloaded the 3.1 SVN version of CKEditor, it's there's a link to it on the CKEditor module page.
Secondly, i added a small bit of code to my /ckeditor/ckeditor.config.js. Here it is.
Original:
Updated:
Is this needed for each theme?
Does one have to modify this code for every theme?
I bounce back and forth between pixture and one other theme.
No.
You can just set the else if ( ...theme == '<theme>') to an else instead, or remove the condition and just set extracss to text-align:left;
Same thing happened to me...
I had the same thing happen with FCKEditor, once I moved it into the /libraries folder and installed the WYSIWYG module in the /modules directory, all the alignment buttons came back and worked. I did not have to touch a single digit of code.
I'm using sites/all/modules
I'm using sites/all/modules as my module directory as i understand that that is the correct directory to use for non-core modules.
Should not use together with WYSIWYG module???
I thought you are not supposed to use FKEditor/CKEditor module and WYSIWYG module at the same time?
_
Yep-- you should use only ONE drupal module (wysiwyg, ckeditor, or fckeditor).
WYSIWYG is NOT an editor module in itself...
"you should use only ONE drupal module (wysiwyg, ckeditor, or fckeditor)"
That is actually incorrect, WYSIWYG was specifically designed to be used WITH other editors. Please review description of module:
http://drupal.org/project/wysiwyg
Especially this part: "Wysiwyg module does not do anything useful until there is at least one editor library, such as TinyMCE, FCKeditor, or NicEdit." So it IS supposed to be used with an editor installed.
Highlights:
"It simplifies installation and integration of editors and allows to assign an editor to each input format."
"Wysiwyg module allows Drupal modules to integrate with all editors - without having to implement editor-specific code."
You place the editor you want to use in sites/all/libraries/[your_choice_of_editor]. Then you enable the WYSIWYG module in Site building>>Modules, then you can configure it under Site configuration>>WYSIWYG. After installing FCKEditor in sites/all/libraries, and WYSIWYG under sites/all/modules, the problem I had with the justify button (the problem the original poster had as well) was resolved. Again, without even a single line of code, script, or anything even typed, it is all clicking and selecting.
The Site configuration>>WYSIWYG menu even tells you the EXACT path for no less than 9(!) editors' installation directories. It even detects if the editor is installed, and if it is not, the download link is provided! It truly is an amazing module, and there is a reason the management of editors was consolidated into the WYSIWYG module.
It is all documented in the installation manual at http://drupal.org/node/371459
There is also the FAQ: http://drupal.org/node/417166
From the questions and replies posted so far here it kind of looks like some of the posters have not read those documents yet...
So there are two answers to the original posters question:
"Does one need to install WYSIWYG module at all if using CKEditor?"
One answer is all the lengthy discussion above about code, scripts, "else" statements, and all that wizardry. That is one way.
Or, the short, and practical answer:
YES!
_
NO it's not correct-- you need to go back and reread the project page as well as my comment.
Yes, wysiwyg can be used with multiple editor SCRIPTS, however it is not specifically designed for use with multiple editor DRUPAL MODULES. Though one can install http://drupal.org/project/wysiwyg, http://drupal.org/project/fckeditor, http://drupal.org/project/ckeditor, and http://drupal.org/project/tinymce, and they may or may not work, this is likely to cause multiple problems. I've been noticing that people are have been installing http://drupal.org/project/wysiwyg as well as http://drupal.org/project/fckditor and running into problems-- THIS IS NOT SUPPORTED.
Absolutely correct, see clarification below.
You are correct, I did try to clarify the whole terminology further below, probably I should have done it in the same post. What I call libraries, you call scripts, and that is a better term.
Further, I have actually put both modules in the sites/all/modules directory in a multisite environment, but did not enable both in the same site, and even made it clear in my post not to do that. I certainly may have sounded confusing some with that. To clarify, again, you and I are talking about the same thing, I guess I should have made the terminology more clear, I used the word libraries because you place the editor scripts in the sites/all/libraries folder, so it is easy for me to visualize. Apologies for the confusion.
Where did "scripts" come from?
"you need to go back and reread the project page"
I did. The project page at http://drupal.org/project/wysiwyg does not even contain the word "script" anywhere (at least not where my browser's search function could find it), but talks about "library" at least three times I counted:
"Each editor library is integrated through support files"
"Support for various editor libraries is built-in"
"Do not download/extract editor libraries upfront".
The Installation guide at http://drupal.org/node/371459 says
"Wysiwyg module does not do anything useful until there is at least one editor library"
So I can see how this can be confusing to a user if we are trying to explain it to them when there is not even a consensus on terminology. If WYSIWYG keeps referring to editors as "libraries", that is fine, but that should be common across the Drupal modules board, so users do not get confused, especially when they even have to upload files into a likewise named directory that does not exist in an out-of-the box installation. I think WYSIWYG does provide a good guide on what to copy where. Another problem may pop up, though, when editors come in a compressed archive with a set-up folder structure to supposedly make it easier for users to drop the files in the right place on the site (leaving "helpful" readme.txt files instructing users to just copy this or that module/library/script in the empty folder), but some of these editors are not aware of the WYSIWYG "libraries" directory requirement.
So in the end, hopefully we solved the originasl poster's button issue, and we also established the terminology discrepancy. Chalk another one up for the power of the community.
"Does one need to install
And again-- the answer is NO. One can choose to use http://drupal.org/project/ckeditor -- there are differences between the two modules and not all ckeditor functionality is exposed through the wysiwyg module. There are configurations you can do with the ckeditor module that you simply cannot do with wysiwyg at this time. That is not to say one is superior or inferior-- you just need to know that there are differences. I use both depending on the needs of the site.
You really need to be careful to clarify what is your opinion versus what is fact when making posts in the forums. It's counter productive to make statements of fact that are actually opinions. Users are best served by being presenting with facts and being allowed to make decisions and choices for themselves.
Again, sorry about the confusion...
I recreated the problem the original poster had, and I solved it the way I described it, dropping the FCKEditor script in libraries, and enabling WYSIWYG module. That was not a personal opinion that it worked for me on the first try without any of the coding solutions mentioned above. That is just what happened, so I posted it as a solution that worked. You are absolutely right about various supported and unsupported functionalities in editors, but the original intention was to solve that one problem with the left justify button, which this solution seems to solve, at least in my configuration.
You are also correct about making it clear what is personal opinion, I did provide two choices, and I felt the WYSIWYG solution would better serve the poster with the problem, and that is what the community is about, getting the most efficient solution to fellow Drupalers. At the point where the poster was in his button problem, the fastest solution appeared to be the WYSIWYG one. Of course, nobody is forcing a decision on users, but at some point, they probably instead of esoteric lectures, they just want the "OK, where do I click, what do I do?" answer. This should help in making them feel welcome in the Drupal community. The more encouraged they feel, the more productive members they will become, and that should give us all the satisfaction of growing the community.
Again, sorry about the terminology confusion. No, at no point am I suggesting to install and enable two editor MODULES in the same site. Hopefully we were able to get that point out...
Clarification: Editor Libraries vs. Modules
Just to clarify, because we have been using multiple ways to refer to modules, editors, libraries: You use WYSIWYG Drupal MODULE with editors/editor LIBRARIES, not editor Drupal modules. You CAN have both modules installed in sites/all/modules, if, for whatever reason, in a multisite installation you do not want to enable WYSIWYG in some sites, but you should not have both MODULES enabled in the same site.
Update
Drupal 6.17
CKEditor module 6.x-1.1
CKEditor 3.3.1
Customised theme: 960 Robots
I just had the same issue as the OP - clicking the left justify button didn't work (it actually seems to trigger the centre justify button instead). Tried switching to the WYSIWYG module instead, but problem persisted. I did however notice that switching back to default theme fixed the problem, but this is obviously not a viable solution.
So anyway, it turns out Joar's solution works (thanks!) - just adding an extra text-align:left rule in the ckeditor.config.js file. There was already a dummy statement in the file, just before the if(theme==marinelli) bit:
config.extraCss = '';
Which I changed to
config.extraCss = 'body{text-align:left;}';
This works
Thanks for saving me the time and grief figuring this out. :)
Agreed
I had the same problem, but I did not have the WYSIWYG module installed. When using a theme other than the standard ones, my text would not left justify in the CKEditor window. When I saved my edits, the text did indeed justify left, but you could not see that in the editor. Editing the JS file above to include my default theme solved the issue for me.
Thank you VERY much for figuring that out!
Marc Dube' Website Developer
i USED THIS CSS TO GET A WORD WRAP FOR IMAGES MAYBE IT CAN WORK FOR
ALSO
}
img {
float:left;
display: inline;
padding:5px 5px 5px 5px;
margin:0 10px 10px 0;
border: 1px solid #00AADB;
}
.rteright img {
display:inline;
float:right;
clear:right;
margin:0 0 0 8px;
}