Extension talk:FCKeditor (Official)/Old Tips and Tricks

From MediaWiki.org
Jump to: navigation, search

Contents

[edit] Question: I get this error on installation of nightly build (linked from this page) Detected bug in an extension! Hook FCKeditor_MediaWiki::onCustomEditor failed to return a value; should return true to continue hook processing or false to abort.

   Answer: Hook error thread 


[edit] Question: Please explain how to set up the Rich Editor and Open Rich editor in new window button on the Edit Page.

I have downloaded the package and placed it in the directory as stated above but those two links on the edit page is missing. I would like the editor to operate as in the [Sandbox]. I would apreciate your help in integrating this useful tool to a mediawiki.
   Answer: ???? 

The bundled FCKEditor (2.6.4) has a bug in WebKit browsers (Safari/Chrome) where the editor does not occupy the full vertical space of the textarea until you click a button in the FCKEditor toolbar. This can be fixed by replacing the ./extensions/FCKEditor/fckeditor directory with version 2.6.6 of FCKEditor. Download here: http://ckeditor.com/download -CVN I've had the same problem you have to be sure it is the Fckeditor

[edit] Q: Is it possible to disable FCKEditor on a per user basis?

Some of our editors prefer to use the standard editor, and others prefer the FCKEditor. There doesn't seem to be an option in the User Preferences of the Wiki.

A: Yes; In the "my preferences" section on the "misc" tab you can apply many options to contol the "Rich Text Editor"

[edit] Q: It does not work for french (ça ne fonctionne pas en français)..

A: There are mistakes in the file FCKeditor.i18n.php, the quotes are not well set. Replace the french section by (remplacez le paragraphe de français par) :

/** French (Français) 
* @author Crochet.david
* @author IAlex
* @author Verdy p
*/

$messages['fr'] = array( 'fckeditor-desc' => 'Permet la modification en utilisant l’éditeur WYSIWYG FCKeditor',
                        'textrichditor' => 'Éditeur de texte enrichi',
                        'prefs-fckeditor' => 'Éditeur enrichi',
                        'tog-riched_disable' => "Désactiver l’éditeur enrichi",
                        'tog-riched_disable_ns_main' => "Désactiver l’éditeur enrichi dans l’espace de noms principal.",
                        'tog-riched_disable_ns_talk' => "Désactiver l’éditeur enrichi dans l’espace de noms « Talk ».",
                        'tog-riched_disable_ns_user' => "Désactiver l’éditeur enrichi dans l’espace de noms « User ».",
                        'tog-riched_disable_ns_user_talk' => "Désactiver l’éditeur enrichi dans l’espace de noms « User talk ».",
                        'tog-riched_disable_ns_project' => "Désactiver l’éditeur enrichi dans l’espace de noms « Project ».",
                        'tog-riched_disable_ns_project_talk' => "Désactiver l’éditeur enrichi dans l’espace de noms « Project talk ».",
                        'tog-riched_disable_ns_image' => "Désactiver l’éditeur enrichi dans l’espace de noms « File ».",
                        'tog-riched_disable_ns_image_talk' => "Désactiver l’éditeur enrichi dans l’espace de noms « File talk ».",
                        'tog-riched_disable_ns_mediawiki' => "Désactiver l’éditeur enrichi dans l’espace de noms « MediaWiki ».",
                        'tog-riched_disable_ns_mediawiki_talk' => "Désactiver l’éditeur enrichi dans l’espace de noms « MediaWiki talk ».",
                        'tog-riched_disable_ns_template' => "Désactiver l’éditeur enrichi dans l’espace de noms « Template ».",
                        'tog-riched_disable_ns_template_talk' => "Désactiver l’éditeur enrichi dans l’espace de noms « Template talk ».",
                        'tog-riched_disable_ns_help' => "Désactiver l’éditeur enrichi dans l’espace de noms « Help ».",
                        'tog-riched_disable_ns_help_talk' => "Désactiver l’éditeur enrichi dans l’espace de noms « Help talk ».",
                        'tog-riched_disable_ns_category' => "Désactiver l’éditeur enrichi dans l’espace de noms « Category ».",
                        'tog-riched_disable_ns_category_talk' => "Désactiver l’éditeur enrichi dans l’espace de noms « Category talk ».",
                        'rich_editor_new_window' => "Ouvrir l’éditeur enrichi dans une nouvelle fenêtre",
                        'tog-riched_start_disabled' => "Démarrer avec l’éditeur enrichi désactivé",
                        'tog-riched_use_popup' => "Ouvrir l’éditeur enrichi dans une popup",
                        'tog-riched_use_toggle' => "Donner la possibilité de changer entre l’éditeur original WikiText et l’éditeur enrichi",
                        'tog-riched_toggle_remember_state' => "Se souvenir de la dernière selection de l’éditeur", );


[edit] Q: FCKEditor seemed to install fine, but when I click the "Use Rich Editor" link, I get the following Javascript error: Line 108, Char 3, Error: Access is denied, Code: 0, URL: http://www.unisigep.com/ltf/index.php?title=Issues/opportunities&action=edit.

Is this a file permissions issue? Any ideas?

A1: $wgServer is being set incorrectly based on the default logic. Force $wgServer to the correct base URL (e.g., http://example.com) in LocalSettings.php. Make sure that $wgServer . $wgScriptPath . '/index.php' evaluates to the correct URL to land you on the main page of your wiki.

A2: wgServer is not defined in ajax.js (maybe because a https)

To fix this, I added this code to the skin template straight below <head> tag:

<script type="text/javascript"> 
var wgServer = "http://example.com/wiki";
var wgScriptPath = "/wiki";
var wgScript = wgScriptPath + "/index.php";
</script>

Where example.com is the name of your domain and /wiki is the path to your wiki.

(Addendum: For Monobook, you change this in skins/MonoBook.php)


[edit] Q: How can I get the clipboard to work as I expect?

In my installation, every time I paste, a javascript dialog box pops up prompting me to paste plain text. At the very least, I would like to be able to copy-paste text without this box appearing... and at best, I would like for the copy-paste functionality to also maintain formatting. Both of these requirements are satisfied and working well for me in the FCKeditor demo here: http://www.fckeditor.net/demo

A: add the following lines to extensions/FCKeditor/fckeditor_config.js

FCKConfig.AutoDetectPasteFromWord = true;
FCKConfig.CleanWordKeepsStructure = false;
FCKConfig.ForcePasteAsPlainText = false;

The above doesn't seem to actually work to solve this problem.

A2: You may also need to allow Javascript to control the context menus. This is either or situation; changing this may be unacceptable because it affects the operation of the browser. Firefox: in Menu item "Tools", "Options", "Content" Tab, Click on "Advanced" across from "Enable Javascript". Change the setting of the checkmark box "Disable or Replce Context Menus". Internet Explorer: Will prompt you to allow access to Javascript and Clipboard. Allow both items.

It worked for me. Clear your cache. Also, make sure you delete the existing line that says "FCKConfig.ForcePasteAsPlainText = true ;" -CVN

[edit] Q: Is it possible to indent bullet list.

In the wiki system you can use ** to indent the bullet list. Is it possible to build this in the rich editor ?

A: In fckeditor_config.js add the following to the button configuration: 'Outdent','Indent' - use these to change the indentation of the bullet points.

[edit] Q: Is it possible to add a button to change text color?

A1: To enable buttons to change font color in the toolbar, do the following: open fckeditor_config.js file (located inside of extensions/fckeditor directory) uncomment two buttons:

       ['TextColor','BGColor'],

save the file, clear your browsers cache done!

A2: If you can't see the third toolbar (for example with the text color buttons) you have to add this line below of the require_once command in the LocalSettings.php:

    $wgFCKEditorToolbarSet   = "Wiki";

You'll notice that 'Wiki' is the name of the variable used when setting what buttons to show in the fckeditor_config.js file. Adding 'Default' will ignore settings made there and use the default layout instead. I imagine you could setup multiple layouts ('AdvancedWiki' and 'SimpleWiki') in fckeditor_config.js, and quickly change back and forth by making this change in the LocalSettings.php file.

[edit] Q: Getting this error after making the changes

Warning: require_once(/www/htdocs/w009ee69/includes/ParserOptions.php) [function.require-once]: failed to open stream: No such file or directory in /www/htdocs/w009ee69/extensions/FCKeditor/FCKeditor.php on line 29

Fatal error: require_once() [function.require]: Failed opening required '/www/htdocs/w009ee69/includes/ParserOptions.php' (include_path='/www/htdocs/w009ee69:/www/htdocs/w009ee69/includes:/www/htdocs/w009ee69/languages:.:/usr/share/php:..') in /www/htdocs/w009ee69/extensions/FCKeditor/FCKeditor.php on line 29

A: You need to use MediaWiki 1.10.x or higher! OR...your extension installed into the wrong folder. A similar error may be the result of invalid permissions on the FCKEditor directory. For IIS servers on Windows: ensure that all permissions (ACLs) on the files are inherited from the parent.

[edit] Q: Is there a possibility to add Links to Categories and give the Link another names, like the command: Editors directly without changing into the Wikitext-mode?

A:Simply type out the name you want your link to show up as, highlight it, then apply the link by clicking on the link toolbar button.In the prompt, type in ":Category:Editors" (without quotes). Click "OK". Link is now applied.

[edit] Q: Is there a way to actually add documents with this tool?

For example, if you insert an image, it is Xyz.jpg and you can do that from the image button. I have documents that are uploaded into my wiki that I can include in wiki text via media:xyz.doc - my end users want a button for this. it that possible and I just can't figure it out?

A: --This is an image i searched for using Rich Editor interface --This is an image i searched for using Rich Editor interface The Rich Editor includes an image button. Click the button and type part of the file name in the search box. Finally choose the layout for the image and click ok.

Comment: this doesn't answer the question. Though the editor can really insert images, files and external links in HTML, these features are disabled in connection with Mediawiki. Would need a patch here!

A: I have a different solution to insert "Media:" links. See http://www.rakekniven.de/content/insert-media-links-using-insert-image-button-wiki

[edit] Q: I have exactly the same requirement: I need to insert documents in-line, not images.

Comment: Nor does the insert image option on the toolbar have the option to upload or anything but the basic tab...

[edit] Q: How can I link to an outside website without changing to wikitext mode as in:

[www.google.com Google]?

A: The Rich Editor includes a Link button. You can use that to create external links.

[edit] Q: How do you make the rich editor the default for all users?

A: You need to edit ./extensions/FCKeditor/FCKeditor.php and change the boolean field for Disabled Start. Find

   $wgDefaultUserOptions['riched_start_disabled'] = 1; 

and change to this

   $wgDefaultUserOptions['riched_start_disabled'] = 0; 

[edit] Q: How can I dissable rich text editing on a per-page basis?

I'd like to be able to put something in the page like __NORICHTEXT__ to make it impossible to edit just that page with the rich text editor.

[edit] Q: How can you display the same toggle links that visitors see to logged in users.

(Allowing the switch between FCK and Wiki editor. My logged in users are unable to access the Wiki's default editor.

A1: If you go to "My Preferences", "Misc" tab and enable "Use toggle to select between wikitext and rich editor" a toggle link will appear when logged in. This works in FCKeditor version 2.6.3 in IE and Firefox.

A2: To do this automaticly go in $MEDIA_WIKI_ROOT/maintenance/ and do this:

   php userOptions.php riched_use_toggle --old  --new 1 

[edit] Q: I've just installed FileLink which adds a button to the normal editor, however I'd like to have this same button in FCKeditor. Is this possible to add?

[edit] Q: I have the FileLink Extension installed too, and when I disable the Rich Editor, I do not have the FileLink button, but the script wich is executed when I desactivate the FCK Editor?

[edit] Q: Hi! I would like to know how to:

  1. deactivate FCK editor in template namespace for all users,
  2. get the same blue link as in this site in order to get back the standard windows,
  3. avoid that FCK change
Personal tools
Namespaces

Variants
Actions
Navigation
Support
Download
Development
Communication
Print/export
Toolbox