Difference between revisions of "WikiServer - Configuring the Wiki"

From The TinkerNet Wiki
Jump to navigation Jump to search
 
(19 intermediate revisions by 2 users not shown)
Line 1: Line 1:
== Uploadable File Types ==
+
Little snippets of configuration to add to LocalSettings.php...
  
* <code>sudo vim /var/www/wiki/LocalSettings.php</code>
+
To add any of them:
  
 +
*<code>sudo vim /var/www/wiki/LocalSettings.php</code>
 +
 +
==Uploadable File Types==
 
search for $wgFileExtensions
 
search for $wgFileExtensions
  
Line 16: Line 19:
 
You likely don't want ino, c, cpp, h
 
You likely don't want ino, c, cpp, h
  
== Open external links in new window ==
+
==Open external links in new window==
  
 
  #########################################
 
  #########################################
Line 23: Line 26:
 
   
 
   
 
  $wgExternalLinkTarget = '_blank';
 
  $wgExternalLinkTarget = '_blank';
 +
 +
Internal links will always open in parent window. If you want to change that, follow the next setup instruction...
 +
 +
==Assign how links are opened by 'groups'==
 +
If you would like to have some links open in the parent window ( '_self' ) and some open in a new window ( '_blank' ), you can identify a link as part of a group (foo or bar in this case) and tell the wiki how the group is to be treated.
 +
 +
Install [[mediawikiwiki:Extension:LinkTarget|Extension:LinkTarget]] by first [[mediawikiwiki:Special:ExtensionDistributor/LinkTarget|downloading]] the file and pasting it into your Extensions folder of your wiki install. Then paste the following into your LocalSettings.php file below the default installed code:
 +
 +
require_once "$IP/extensions/LinkTarget/LinkTarget.php";
 +
$wgLinkTargetParentClasses = ' /*ENTER SOME CLASSES HERE*/ ';
 +
 +
This sets up the extension and creates classes for filtering. Place the following below that:
 +
 +
$wgExternalLinkTarget = '_blank';
 +
$wgLinkTargetParentClasses = array( 'foo', 'bar' );
 +
$wgLinkTargetDefault = '_self';
 +
 +
The above will default all INTERNAL links to open in a new window unless specified like below...In the wiki:
 +
 +
<nowiki>[[This link]] will open in a new window, but not <span class="foo">[[this one]], [[or this one]], [[this one either]]</span>.</nowiki>
 +
 +
You can change the the default behavior by changing '_self' to '_blank' or vice-versa.
 +
 +
==InterWiki Links==
 +
 +
#########################################
 +
# InterWiki configuration
 +
#########################################
 +
 +
// To grant sysops permissions to edit interwiki data
 +
$wgGroupPermissions['sysop']['interwiki'] = true;
 +
 +
// To create a new user group that may edit interwiki data
 +
// (bureaucrats can add users to this group)
 +
# $wgGroupPermissions['developer']['interwiki'] = true; // delete the comment indicator # as appropriate
 +
See [[WikiServer - InterWiki Linking|InterWiki Linking]] for a little bit more detail
 +
 +
==There was gonna be a VisualEditor thing here, but wait a month... May be a moot point...==

Latest revision as of 03:46, 28 July 2020

Little snippets of configuration to add to LocalSettings.php...

To add any of them:

  • sudo vim /var/www/wiki/LocalSettings.php

Uploadable File Types

search for $wgFileExtensions

If you don't find it, you can add it.

on my wiki, it looks like:

#########################################
# Uploadable File Types
#########################################
$wgFileExtensions = array( 'png', 'gif', 'jpg', 'jpeg', 'pdf', 'epub', 'ino', 'c', 'cpp', 'h', 'zip', 'gz', 'mp3', 'txt' );

You likely don't want ino, c, cpp, h

Open external links in new window

#########################################
# Open external links in new window.
#########################################

$wgExternalLinkTarget = '_blank';

Internal links will always open in parent window. If you want to change that, follow the next setup instruction...

Assign how links are opened by 'groups'

If you would like to have some links open in the parent window ( '_self' ) and some open in a new window ( '_blank' ), you can identify a link as part of a group (foo or bar in this case) and tell the wiki how the group is to be treated.

Install Extension:LinkTarget by first downloading the file and pasting it into your Extensions folder of your wiki install. Then paste the following into your LocalSettings.php file below the default installed code:

require_once "$IP/extensions/LinkTarget/LinkTarget.php";
$wgLinkTargetParentClasses = ' /*ENTER SOME CLASSES HERE*/ ';

This sets up the extension and creates classes for filtering. Place the following below that:

$wgExternalLinkTarget = '_blank';
$wgLinkTargetParentClasses = array( 'foo', 'bar' );
$wgLinkTargetDefault = '_self';

The above will default all INTERNAL links to open in a new window unless specified like below...In the wiki:

[[This link]] will open in a new window, but not <span class="foo">[[this one]], [[or this one]], [[this one either]]</span>.

You can change the the default behavior by changing '_self' to '_blank' or vice-versa.

InterWiki Links

#########################################
# InterWiki configuration
#########################################

// To grant sysops permissions to edit interwiki data
$wgGroupPermissions['sysop']['interwiki'] = true;

// To create a new user group that may edit interwiki data
// (bureaucrats can add users to this group)
# $wgGroupPermissions['developer']['interwiki'] = true; // delete the comment indicator # as appropriate

See InterWiki Linking for a little bit more detail

There was gonna be a VisualEditor thing here, but wait a month... May be a moot point...