![]() Release status: unmaintained |
|
---|---|
Implementation | Parser extension |
Description | Enables licenses to be set on a per-namespace or per-page basis |
Author(s) | (Leucostictetalk) |
Latest version | 1.1.0 (2017-10-30) |
Compatibility policy | Snapshots releases along with MediaWiki. Master is not backward compatible. |
MediaWiki | 1.23+ |
Database changes | No |
License | GNU General Public License 3.0 or later |
Download | Download extension Git [?]: |
Example | http://wiki.mises.org |
Parameters
|
|
Hooks used
|
|
Quarterly downloads | 0 |
Translate the PerPageLicense extension if it is available at translatewiki.net | |
The PerPageLicense extension enables license footer variables (viz. $wgRightsIcon
, $wgRightsUrl , and $wgRightsText ) to be set on a per-namespace or per-page basis.Download
The extension can be retrieved directly from Git [?]:
- Browse code
- Some extensions have tags for stable releases.
- Browse tags
- Select the tag
- Click "snapshot"
- Each branch is associated with a past MediaWiki release. There is also a "master" branch containing the latest alpha version (might require an alpha version of MediaWiki).
- Browse branches
- Select a branch name
- Click "Continue"
Extract the snapshot and place it in the extensions/PerPageLicense/ directory of your MediaWiki installation.
If you are familiar with Git and have shell access to your server, you can also obtain the extension as follows:
cd extensions/
git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/PerPageLicense.git
Installation
- Download and place the file(s) in a directory called
PerPageLicense
in yourextensions/
folder. - Add the following code at the bottom of your LocalSettings.php
require_once "$IP/extensions/PerPageLicense/PerPageLicense.php";
file: Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.
Configuration
Change these settings to your liking, making sure that you include them in LocalSettings.php
after the require_once
line installing the extension.
// <translate nowrap><!--T:12--> Page from which to obtain templates and associated licenses.</translate>
$wgPerPageLicenseTemplatePage = 'MediaWiki:License-templates';
// <translate nowrap><!--T:13--> Array of licenses.</translate>
$wgPerPageLicenseLicenses = array (
'cc-0' => array(
'url' => 'http://creativecommons.org/publicdomain/zero/1.0/',
'src' => "{$wgStylePath}/common/images/cc-by-sa.png",
'alt' => 'Creative Commons 0',
),
'cc-by-nc-sa' => array(
'url' => 'http://creativecommons.org/licenses/by-nc/3.0/',
'src' => "{$wgStylePath}/common/images/cc-by-nc-sa.png",
'alt' => 'Creative Commons Attribution-NonCommercial 3.0 Unported',
),
'cc-by' => array(
'url' => 'http://creativecommons.org/licenses/by/3.0/',
'src' => "{$wgStylePath}/common/images/cc-by.png",
'alt' => 'Creative Commons Attribution 3.0 Unported',
),
'cc-by-sa' => array(
'url' => 'http://creativecommons.org/licenses/by-sa/3.0/',
'src' => "{$wgStylePath}/common/images/cc-by-sa.png",
'alt' => 'Creative Commons Attribution Share-Alike 3.0 Unported',
),
'gnu-fdl' => array(
'url' => 'http://www.gnu.org/copyleft/fdl.html',
'src' => "{$wgStylePath}/common/images/gnu-fdl.png",
'alt' => 'GNU Free Documentation License',
),
'public-domain' => array(
'url' => 'http://creativecommons.org/licenses/publicdomain/',
'src' => "{$wgStylePath}/common/images/public-domain.png",
'alt' => 'public domain'
),
);
// <translate nowrap><!--T:14--> Array of namespaces and their licenses.</translate>
$wgPerPageLicenseNamespaces = array();
As an example, you might put:
$wgPerPageLicenseNamespaces = array (
0 => 'cc-0',
);
This would license everything in mainspace as Creative Commons Zero.
Usage
Edit MediaWiki:License-templates on your wiki. Add templates and their associated licenses. Put each on a separate line. E.g.:
|Wikipedia text || cc-by-sa
Now any page with the {{Wikipedia text}} template will show the license footers for CC BY-SA. Note that in the event of a conflict between per-namespace and per-page licensing, the per-page licensing prevails.