FCKeditor integration guide
From MediaWiki+FCKeditor
Contents |
[edit] Installation
[edit] Download FCKeditor and MediaWiki Extension
You can either download FCKeditor and the Mediawiki Extension as a bundled archive, or check out the latest versions of FCKeditor and the MediaWiki Extension separately from SVN.
[edit] Bundled Archive
- Download the nightly build of the FCKeditor for MediaWiki extension.
- zip file: http://mediawiki.fckeditor.net/nightly/svn/mediawiki_fckeditor_ext_N.zip (Size: 1,2 MB, FCKeditor 2.6.4 included).
- tar.gz file: http://mediawiki.fckeditor.net/nightly/svn/mediawiki_fckeditor_ext_N.tar.gz (Size 1 MB, FCKeditor 2.6.4 included).
- Extract the archive to your MediaWiki root directory. You should be able to access the directory extensions/FCKeditor/fckeditor from your MediaWiki root
[edit] SVN
In SVN repository, the extension does not contain the editor itself. If you are a UNIX user, you must install the Subversion package unless it's already installed. If you are a Windows user, read the SVN_Instructions for more details.
- On UNIX, you can type the following command to install the FCKeditor Mediawiki extension in your $IP/extensions directory:
svn checkout http://svn.fckeditor.net/MediaWiki/trunk $IP./extensions/FCKeditor
- You will also need to download the actual editor. It can be downloaded from SourceForge. See FCKeditor's download page for more details.
- You can check out the standalone FCKeditor into [MEDIAWIKI ROOT]/extensions/FCKeditor/fckeditor, but this is not recommended for production systems
svn checkout http://svn.fckeditor.net/FCKeditor/trunk $IP./extensions/FCKeditor/fckeditor
- Alternatively, you can check out the MediaWiki extension as above, then download the nightly standalone FCKeditor build and extract it to [MEDIAWIKI ROOT]/extensions/FCKeditor/fckeditor
[edit] Verify Directory Structure and Configuration Files
A condensed version of the directory structure is shown below. On Unix, you can view an expanded version of this with the "tree $IP" command.
- [MEDIAWIKI ROOT, aka $IP]
- -- AdminSettings.php
- -- LocalSettings.php
- -- extensions
- -- FCKeditor
- -- FCKeditor.php
- -- fckeditor
- -- editor
- -- _source
- ...
- -- editor
- -- FCKeditor
Verify the files fckeditor_config.js and /plugins/mediawiki/fckplugin.js exist.
[edit] Modify configuration file
After you've downloaded the extension and actual editor, add this line at the end of LocalSettings.php:require_once("$IP/extensions/FCKeditor/FCKeditor.php");
Also make sure $wgUseAjax is turned on (it is by default on newer MediaWikis), eg in LocalSettings.php, add the line
$wgUseAjax = 'true';
[edit] Tips & Tricks
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;
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.
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.
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.
Q: Is there a possibility to add Links to Categories and give the Link another names, like the command: [[:Category:Editors|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.
Q: Is there a way to actually add documents with this tool?
For example, if you insert an image, it is [[Image: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: 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!
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...
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.
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;
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.
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
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?
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?
Q: Hi! I would like to know how to:
- deactivate FCK editor in template namespace for all users,
- get the same blue link as in this site in order to get back the standard windows,
- avoid that FCK change <includeonly> to <includeonly> (and others) in previously made pages.
- A: 2 things required:
- Edit fckconfig.js , ProcessHTMLEntities (+Latin+Greek) set to FALSE
- Edit fckeditorcode_ie.js,fckeditorcode_gecko.js , disable encode functions (comment where it is neccessary). Check the whole files for "lt;" and check it out.
- do not forget delete all browser cache and history...important also.
- A: for desctivating fck editor in some namespaces (usefull in templates namespaces) use :
$wgFCKexcludedNamespaces = array();
Q: FCK Editor destroys the style of my tables. Is it possible to use "normal" Wiki tables instead of that ugly FCK-Tables ?
Q: He instalado el FCKeditor sobre MediaWiki 1.13 todo desde cero, solo con esa extensión, no me tira ningun tipo de error, el la pagina escial:version se ve que esta instalado el editor, pero a la hora de editar una apgina el editor no aparece, eleimina la barra de edisión standar de MediaWiki y nada mas. alguien le ha pasado?? podrian ayudarme??
Q: ¿Es posible añadir un botón para cambiar el color del texto?
- A1: Para activar los botones para cambiar el color de la fuente en la barra de herramientas, haga lo siguiente:
- fckeditor_config.js abrir el archivo (que se encuentra dentro de las extensiones / fckeditor directorio)
- descomentar dos botones:
[ 'TextColor', 'bgcolor'],</ pre>
- guardar el archivo, borrar su caché de los navegadores ** hecho! *A2: Si usted no puede ver la tercera barra de herramientas (por ejemplo el color del texto con los botones) tiene que agregar esta línea por debajo de la require_once comando en el LocalSettings.php: <pre>$ wgFCKEditorToolbarSet = "Wiki", que te aviso 'Wiki' es el nombre de la variable de ajuste cuando se utilizan los botones para mostrar lo que en el fckeditor_config.js archivo.
añadir 'por defecto' ignorará ajustes realizados allí y utilizar la configuración predeterminada en lugar.
me imagino que usted puede configurar múltiples diseños ( 'AdvancedWiki' y 'SimpleWiki') en fckeditor_config.js, y rápidamente chnage hacia adelante y hacia atrás, haciendo este cambio en el archivo LocalSettings.php .
- guardar el archivo, borrar su caché de los navegadores ** hecho! *A2: Si usted no puede ver la tercera barra de herramientas (por ejemplo el color del texto con los botones) tiene que agregar esta línea por debajo de la require_once comando en el LocalSettings.php: <pre>$ wgFCKEditorToolbarSet = "Wiki", que te aviso 'Wiki' es el nombre de la variable de ajuste cuando se utilizan los botones para mostrar lo que en el fckeditor_config.js archivo.
Q: Obtener este error después de hacer los cambios
Advertencia: require_once (/ www/htdocs/w009ee69/includes/ParserOptions.php) [function.require-una vez]: no abrir corriente: No existe el fichero o directorio en / www/htdocs/w009ee69/extensions/FCKeditor/FCKeditor.php en la línea 29
Fatal error: require_once () [function.require]: Failed opening necesario '/ www/htdocs/w009ee69 / includes / ParserOptions.php '(include_path =' / www/htdocs/w009ee69: / www/htdocs/w009ee69/includes: / www/htdocs/w009ee69/languages:. / usr / share / php :..') en / www/htdocs/w009ee69/extensions/FCKeditor/FCKeditor.php en la línea 29
- A: Necesita usar MediaWiki 1.10.x o superior!
- O ... su extensión instala en la carpeta equivocada.
Q: ¿Existe una posibilidad de añadir enlaces a las categorías y la otra los nombres de Enlace, al igual que el comando: [[: Categoría: Editores | Editores]]
</ span> directamente sin modificar en la Wikitext modo?
- A:
- Simplemente escriba el nombre que usted quiere que su enlace aparezca como, resáltela y, a continuación, aplicar el vínculo haciendo clic en el botón de barra de herramientas de enlace.
- En el símbolo del sistema, escriba ": Categoría: Editores" (sin comillas).
- Haz clic en "Aceptar".
- Enlace se aplica actualmente.
Q: ¿Existe realmente una manera de añadir documentos con esta herramienta? Por ejemplo, si inserta una imagen, es [[Imagen: Xyz.jpg]] </ nowiki> y que puede hacer que la imagen de botón. tengo los documentos que se suben a mi wiki que puedo incluir en el wiki de texto a través de <nowiki> [ [medios de comunicación: xyz.doc]] - mi los usuarios finales desean un botón para ello. lo que sea posible y yo simplemente no puede con ello?
- A: El Rico editor de imagen incluye un botón. Haga clic en el botón y escriba parte del nombre de archivo en el cuadro de búsqueda. Por último elija el diseño de la imagen y haga clic en Aceptar.
- Comentario: esto no responde a la pregunta.
Q: Tengo exactamente la misma obligación: tengo que insertar los documentos en línea, no imágenes. ¡Gracias!
- Comentario: Tampoco la opción de insertar la imagen en la barra de herramientas tienen la opción de subir o algo, pero la ficha de base ...
Q: ¿Cómo puedo enlazar a una página web fuera sin cambiar a modo wikitext como en: [Google www.google.com]
- A: La enriquecido Editor incluye un botón de enlace.
Usted puede usarlo para crear los enlaces externos. [Http://google.com google.com]
Q: ¿Cómo se hace el rico editor por defecto para todos los usuarios?
- A: Es necesario editar. / extensions / FCKeditor / FCKeditor.php y cambiar el campo booleano de inicio para personas de movilidad reducida.
Encuentra;$ wgDefaultUserOptions [ 'riched_start_disabled'] = 1; </ pre> para este <pre> $ wgDefaultUserOptions [ 'riched_start_disabled'] = 0; </ pre>
Q: ¿Cómo se puede mostrar la misma alternar los vínculos que los visitantes ver a usuarios registrados. (Permitir que el cambio entre FCK Wiki y editor. Mis usuarios registrados no pueden acceder a la Wiki del editor por defecto.
- 'A1: "Si usted ve a" Mis Preferencias "," Varios "y permitir" Utilizar para seleccionar alternar entre ricos wikitext y editor de "cambiar un vínculo aparecerá cuando conectado FCKeditor Esto funciona en la versión 2.6.3 en IE y Firefox.
- A2: Para hacer esto automáticamente va en $ MEDIA_WIKI_ROOT / mantenimiento / y hacer esto: <pre> php userOptions.php riched_use_toggle - antiguo- nuevo 1
Q: Acabo de instalar FileLink, que añade un botón para el editor normal, sin embargo me gustaría que este mismo botón en FCKeditor. ¿Es posible añadir?
Q: He instalado la extensión FileLink demasiado, y cuando los ricos deshabilitar el Editor, no tengo la FileLink botón, pero el script que se ejecuta cuando desactivar la FCK Editor?
Q: ¡Hola! Me gustaría saber cómo:
- desactivar FCK editor en plantilla nombres para todos los usuarios,
- obtener el mismo color azul como enlace en este sitio con el fin de recuperar el estándar de Windows,
- FCK evitar que el cambio <includeonly> para <includeonly> ( y otros) en las páginas anteriores.
- A: 2 cosas necesarias:
- Modificar fckconfig.js, ProcessHTMLEntities (+ latín + griego) establece en FALSE
- Modificar fckeditorcode_ie.js , fckeditorcode_gecko.js, deshabilitar funciones codificar (comentario cuando sea necesario). Compruebe la totalidad de los archivos "lt;" y comprobar que funciona.
- no olvide eliminar todos los caché del navegador y de la historia. importante también .. ¡Gracias!
Q: Hi! this editor work only on textarea named wpTextbox1?if i create my own textarea how i can activate on it FCKeditor?it is possibile?
