Extension:Uniwiki Layouts

From MediaWiki.org
Jump to: navigation, search

Check usage(experimental)

MediaWiki extensions manual - list
Crystal Clear action run.png
Uniwiki Layouts

Release status: experimental

Implementation Page action
Description Populate newly-created pages with editable "layouts", to encourage a common structure to articles
Author(s) Merrick Schaefer,
Mark Johnston,
Evan Wheeler,
Adam Mckaig (UniwikiTalk)
Last version 0.1 (2008-07-18)
MediaWiki 1.12.0
License GPLv3
Download From Subversion
Parameters

$wgAddLayoutLink, $wgLayoutWhiteList, $wgLayoutCategories, $wgLayoutUseCategoryPage, $wgLayoutCategoryPage, $wgLayoutCategoryNSWhiteList, $wgNoLayoutOption

Added rights

editlayouts

Hooks used
CustomEditor

UnknownAction
SkinTemplateSetupPageCss
EditFormPreloadText

Without Uniwiki Generic Edit Page:

Extension (Results)
1.13.5 1.14.0 trunk
r43935
MediaWiki 1.13.2 - - No
1.14.0 - - -
trunk - - -
Configure Supported from 1.15.
MediaWiki Testing

With Uniwiki Generic Edit Page:

Extension (Results)
1.13.5 1.14.0 trunk
r43935
MediaWiki 1.13.2 - - No
1.14.0 - - -
trunk - - -
Configure Supported from 1.15.
MediaWiki Testing

Contents

[edit] What can this extension do?

This extension allows the WikiSysop (or anyone with the "editlayouts" permission) to create pages in the "Layout" namespace, which are subsequently offered as pre-built "templates" (but not in the MediaWiki sense!) to users creating new pages. This is intended to encourage (but not force) users to use a common structure throughout the wiki.

Directives available:

  • @namespace: If layout text has an @namespace restriction, if so only add the layout as a choice if we find the namespace of this page in the layout text (ex. @namespace User Main)

There are also some enhancements when running this extension alongside the Generic Edit Page extension. Before pre-filling the edit page, each section of the chosen Layout is parsed for optional "directives", which provide hints to the Generic Edit Page, slightly affecting its behavior. Currently, the following directives are available:

  • @optional: The section will not be added to the new page as default, but a relevant checkbox will be added to the "sections" menu in the top-right of the Generic Editor.
  • @required: The section will be added to the new page, along with a checkbox in the menu, but it will be disabled, dissuading (not preventing) the user from removing the section. The user is still able to remove the section via the "Classic Mode" of the Generic Edit Page.
  • @lock-header: The section will be added to the new page, but the ==Title== will not be editable in the usual way. As above, this is not enforced in "Classic Mode".
  • @lock-text: As above, but applied to the section body.

[edit] Sample Layout With Directives

This stuff only really works in conjunction with the Extension:Uniwiki_Generic_Edit_Page.
 
 
== This is a Section ==
@lock-header
This section is editable, but its title is not.
 
== This is Another Section ==
@lock-header
@lock-text
Nothing about this section is editable!
 
== One More Section ==
@optional
This won't be added to the created page, but an un-checked checkbox will be added to the menu in the top-right,
and this text will be inserted once it is checked.

[edit] Installation

Create a subdirectory in your extensions directory:
(we do this to make it easy to distribute all Uniwiki extensions as a bundle)

cd /your/wiki/extensions
mkdir uniwiki

Download the extension and its dependencies using Subversion:

cd /your/wiki/extensions/uniwiki
svn checkout http://svn.wikimedia.org/svnroot/mediawiki/trunk/extensions/uniwiki/Layouts

Add the following to LocalSettings.php:

require_once("$IP/extensions/uniwiki/Layouts/Layouts.php");

[edit] Configuration parameters

todo

[edit] Installing the entire Uniwiki bundle

Download all of the Uniwiki extensions using Subversion:

cd /your/wiki/extensions
svn checkout http://svn.wikimedia.org/svnroot/mediawiki/trunk/extensions/uniwiki uniwiki

Add the following to LocalSettings.php:

# uniwiki
# =======
$uw = "$IP/extensions/uniwiki";
require_once("$uw/CssHooks/CssHooks.php");
require_once("$uw/Javascript/Javascript.php");
require_once("$uw/MooTools12core/MooTools12core.php");
require_once("$uw/AutoCreateCategoryPages/AutoCreateCategoryPages.php");
require_once("$uw/GenericEditPage/GenericEditPage.php");
require_once("$uw/CatBoxAtTop/CatBoxAtTop.php");
require_once("$uw/CustomToolbar/CustomToolbar.php");
require_once("$uw/Layouts/Layouts.php");
require_once("$uw/Authors/Authors.php");
require_once("$uw/CreatePage/CreatePage.php");

[edit] Internationalizing Uniwiki extensions

The Uniwiki extensions are available in several languages already, and it is very easy to add a new language. Each extension that has interface text includes a .i18n file with the internationalized system messages. Follow the instructions here to add the new language to the file.

[edit] See also

Sites using uniwiki extensions
Other extensions from the Uniwiki bundle
Personal tools
Namespaces
Variants
Actions
Site
Support
Download
Development
Communication
Print/export
Toolbox