Log in or register to post comments
Last post
m4ko's picture
Joined: 05/04/2005
Posts: 9
Help: Customizing Toolbar
Hi,
I get the editor to run just fine. Both with Basic and Default Toolbars. However I cannot get a Custom Toolbar running.

I tried to edit the default and basic templates ind "fckeditor.php". However the editor completely ignores that. If I delete buttons of the default template in "fckeditor.php" they still show up when running the editor.
I also tried the html sample06 - it calls the editor with <javascript> and calls up a custom.js file which contains a new toolbarset. However I cant get this method to work either !

Code to call editor:
<script type="text/javascript">
var oFCKeditor = new FCKeditor( 'ModusEditor' ) ;
oFCKeditor.BasePath = '/editor/' ;
oFCKeditor.Config['CustomConfigurationsPath'] = 'custom.js'; // Datei fr Konfiguration
oFCKeditor.ToolbarSet = 'PluginTest' ;
oFCKeditor.Value = '{VALUE}';
oFCKeditor.Create() ;
</script>

Code in custom.js:
FCKConfig.AutoDetectLanguage = false ;
FCKConfig.DefaultLanguage = 'de' ;
// Set our sample toolbar.
FCKConfig.ToolbarSets['PluginTest'] = [
['Source'],
['My_Find','My_Replace','-','Placeholder'],
['Table','-','TableInsertRow','TableDeleteRows','TableInsertColumn','TableDeleteColumns','TableInsertCell','TableDeleteCells','TableMergeCells','TableSplitCell'],
['Bold','Italic','-','OrderedList','UnorderedList','-','Link','Unlink','-','About']
] ;

The editor will start loading but resign with the error message "couldnt find toolbar PluginTest" or sth like that.
Also I tried to ADD the PluginTest template into fckconfig.js (directly below the defaul / basic) and still the editor doesnt find it.
m4ko's picture
Joined: 05/04/2005
Posts: 9
RE: Help: Customizing Toolbar
Look at this:
http://php.m4ko.de/fck_test_neu2.php

It works perfectly with those 2 lines commented ( // ):
//soFCKeditor.Config['CustomConfigurationsPath'] = 'custom.js'; // Datei fr Konfiguration
//oFCKeditor.ToolbarSet = 'modus' ;

It wont work at all with those commands uncommented.

- custom.js is right in the same folder
- modus is specified in it
m4ko's picture
Joined: 05/04/2005
Posts: 9
RE: Help: Customizing Toolbar
I am still on this problem. It would help me a lot if anyone that has already made a custom toolbar (not completely new buttons - just a custom selection of buttons from the originals) could tell me what they did.

Or a developer could tell me where the "default" and "basic" tool-bars are stored (besides fckconfig.js) so I can edit them.
m4ko's picture
Joined: 05/04/2005
Posts: 9
RE: Help: Customizing Toolbar
Now i get a message "lenght zero or no object"

Strange. I have just gotten the "PluginTest" toolbar to work in my own script. I then pushed out some Buttons i didnt need: Bang now i get this error.
It seems to me that the editor has some serious bugs !? - Finding the error here is very annoying because it works fine on your sample-page but doesnt over here. Are you using different code ? - Something is wrong ?!

Well - I doublechecked the syntax and the editor will not accept my changes. It only runs with the standard "PluginTest" template. Deleting an unneeded button wont work.

Could you PLEASE specify where exactly you have saved the templates. It seems to me that the editor does not use fckconfig.js and/or the CustomConfig correctly.
salimvirani's picture
Joined: 02/04/2005
Posts: 2
RE: Help: Customizing Toolbar
I had similar problems. First thing you should note is that the editor and it's configuration will stay cached in your browser, so when you change anything, clear your cache.

To change the toolbar, I used a custom config file by adding the following to my header:

<script type=\"text/javascript\">
<!--
window.onload = function()
{
var oFCKeditor = new FCKeditor( 'bodytext' ) ;
oFCKeditor.BasePath = '/widgets/Editor/' ;
oFCKeditor.Config['CustomConfigurationsPath'] = '/admin/editor.conf.js' ;
oFCKeditor.ToolbarSet = 'Default';
oFCKeditor.ReplaceTextarea() ;
}
//-->
</script>

Notice the custom path is absolute, not relative. That may be your problem. You could do something like:
oFCKeditor.Config['CustomConfigurationsPath'] = oFCKeditor.BasePath + 'editor.conf.js' ;

In editor.conf.js, I have:

FCKConfig.ToolbarSets["Default"] = [
['FontFormat'],
['Bold','Italic','StrikeThrough','-','Subscript','Superscript'],
['JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'],
['OrderedList','UnorderedList','-','Outdent','Indent'],
['Link','Unlink','Anchor', 'Rule'],
['Table','SpecialChar','UniversalKey'],
['Cut','Copy','Paste','PasteText','PasteWord','-','SpellCheck'],
['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat', 'Source'],
['About']
] ;

FCKConfig.ToolbarSets["Full"] = [
['Source','DocProps','-','Save','NewPage','Preview'],
['Cut','Copy','Paste','PasteText','PasteWord','-','Print','SpellCheck'],
['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'],
['Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript'],
['OrderedList','UnorderedList','-','Outdent','Indent'],
['JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'],
['Link','Unlink','Anchor'],
['Image','Table','Rule','Smiley','SpecialChar','UniversalKey'],
['Form','Checkbox','Radio','TextField','Textarea','Select','Button','ImageButton','HiddenField'],
'/',
['Style','FontFormat','FontName','FontSize'],
['TextColor','BGColor'],
['About']
] ;

FCKConfig.ToolbarSets["Basic"] = [
['Bold','Italic','-','OrderedList','UnorderedList','-','Link','Unlink','-','About']
] ;

Hopefully, some of this helps.
mic67's picture
Joined: 07/04/2005
Posts: 1
RE: Help: Customizing Toolbar
Hello

I'm following this thread with interest because I have the same problem.
Trying to modify the fckconfig.js file or to add a custom config-file - the editor won't find my new toolbar.

Did you get yours to work?

Regards
mic
m4ko's picture
Joined: 05/04/2005
Posts: 9
RE: Help: Customizing Toolbar
Apparently it IS the browser cache. I should have tried that earlier =( - so if you customize any of the files of this editor I suggest you delete your cache.

However this implies that EVERY visitor of your site that uses that editor has to emtpy his browsercache if you change settings (like toolbarsets) - now thats a big problem.