Maintenance
All wikis at Biowikifarm are in read-only mode due to the restoration after a severe cyberattack in October 2023.
After 1 year being shut down the Biowikifarm is online again.
You see the latest restored version from 18th October 2023.
Difference between revisions of "Visual Editor"
(formatting the trouble shooting section) |
(added section: Enabling Other Namespaces) |
||
Line 18: | Line 18: | ||
$wgVirtualRestConfig['modules']['parsoid']['forwardCookies'] = true; | $wgVirtualRestConfig['modules']['parsoid']['forwardCookies'] = true; | ||
This however has some implications on the security of the closed wiki. Since the parsoid renderer runs on the same machine and is addressed via localhost, this is not as dramatic, however it is advised to read the corresponding section in <code>/var/www/MediaWiki_VisualEditor_Settings.php</code> in order to understand the full implications of this action. | This however has some implications on the security of the closed wiki. Since the parsoid renderer runs on the same machine and is addressed via localhost, this is not as dramatic, however it is advised to read the corresponding section in <code>/var/www/MediaWiki_VisualEditor_Settings.php</code> in order to understand the full implications of this action. | ||
+ | |||
+ | === Enabling Other Namespaces === | ||
+ | By default the Visual Editor is not enabled in all namespaces. To enable it for additional or even custom namespaces, just add a snippet like to the corresponding section of <code>LocalSettings.php</code>: | ||
+ | |||
+ | $wgVisualEditorAvailableNamespaces = [ | ||
+ | NS_HELP => true, | ||
+ | NS_PROJECT => true, | ||
+ | 198 => true, //custom namespace | ||
+ | "_merge_strategy" => "array_plus" | ||
+ | ]; | ||
== Trouble Shooting == | == Trouble Shooting == |
Latest revision as of 12:25, 24 January 2019
This article describes how to enable the Visual Editor on any of the wikis at the Biowikifarm. To see how the Visual Editor extension as well as the required nodejs and parsoid were installed, see the article Parsoid installation
The Visual Editor is an extension that allows users to edit wiki pages using a graphical interface (a WYSIWYG Editor) instead of the regular text edit that requires writing the wiki syntax manually.
Contents
[hide | ◄ ► ]Enabling the Visual Editor
To enable the VisualEditor in a wiki on the Biowikifarm, add the following line to the LocalSettings.php
of that wiki
require_once("$IP/../../MediaWiki_VisualEditor_Settings.php");
Note: sometimes the path has to be adjusted if the directory structure of the wiki is different from the default. It needs to be the same relative path as for inclusion of MediaWikiCommonSettings_REL1_26.php
By default the VisualEditor not enabled even if installed, the users have to enable it in the settings themselves in their preferences under Preferences -> Editing -> Editor -> "Enable the visual editor. [...]".
To enable the VisualEditor by default for all users that have editing rights, add the following line to the LocalSettings.php
:
$wgDefaultUserOptions['visualeditor-enable'] = 1;
Wikis that are not open by default but require users from a certain user group to be logged in, in order to read and edit pages, require this additional line to be added to the LocalSettings.php
:
$wgVirtualRestConfig['modules']['parsoid']['forwardCookies'] = true;
This however has some implications on the security of the closed wiki. Since the parsoid renderer runs on the same machine and is addressed via localhost, this is not as dramatic, however it is advised to read the corresponding section in /var/www/MediaWiki_VisualEditor_Settings.php
in order to understand the full implications of this action.
Enabling Other Namespaces
By default the Visual Editor is not enabled in all namespaces. To enable it for additional or even custom namespaces, just add a snippet like to the corresponding section of LocalSettings.php
:
$wgVisualEditorAvailableNamespaces = [ NS_HELP => true, NS_PROJECT => true, 198 => true, //custom namespace "_merge_strategy" => "array_plus" ];
Trouble Shooting
Failed to include files
Problem: When the extension is added, the wiki page just shows an error message like this:
Fatal error: require_once(): Failed opening required '/var/www/v-wikiname/w/extensions/UniversalLanguageSelector/UniversalLanguageSelector.php' (include_path='.:/var/www/v-wikiname/w:/var/www/v-wikiname/w/includes:/var/www/v-wikiname/w/languages:/usr/share/php/:/usr/share/php/PEAR/') in /var/www/MediaWiki_VisualEditor_Settings.php on line 10
Cause of the Problem:
For the wiki installation the symbolic link extension
points to /usr/share/mediawiki26/extensions-simple-features
instead of /usr/share/mediawiki26/extensions-rich-features
.
This can be easily verified by going into the directory of the wiki installation on the shell and running
ls -l | grep extension
The result will look like this:
lrwxrwxrwx 1 root root 49 Mar 29 2016 extensions -> /usr/share/mediawiki26/extensions-simple-features
Solution To solve this issue, the correct extension directory needs to be linked to instead. Simply run the following commands:
rm extensions ln -s /usr/share/mediawiki26/extensions-rich-features/ extensions