Extension:Uniwiki Layouts

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.

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

Download the extension and its dependencies using Subversion:

Add the following to LocalSettings.php:

Configuration parameters
todo