Please note: Some techniques recommended in this article require the use of extensions. Exercise caution when using them, as the status of each extension is self-assigned by its maintainer, and does not reflect the opinion of the MediaWiki development team. |
Preloading wikitext presents the user with a partially created page, possibly with inline instructions for content organization, rather than a blank page.This technique is especially useful when the wiki contains one or more categories of articles, with lots of pro-forma text or the information that needs to be collected for such articles is a mix of structured data and free form text.
Creating pages with preloaded text is a three step process:
The preload file is often an article with an embedded template.For example, if you wanted one article for each customer or marketing contact, you might want to preload text that looks something like the example below.
<!-- Please enter your customer's contact information after the equal sign. If you need help uploading the business card images, please see [[Help:Uploading business card images]] --> {{CustomerContact |Number= |BizcardImage= |Primary phone number= |Address= }}Some extensions have specific expectations as to where the preloaded text should be stored.Others leave that decision entirely up to the system administrator.
Naming and documenting the preload file takes some care, because preload files don't always show up on "What links here" and so are at risk for accidental deletion (no info/no links—hard to tell from an article that got created and abandoned).For template based preload files, the following naming conventions may help avoid accidental deletion:
Template:CategoryNameTemplate:CategoryName/PreloadPreloading can be done with apreload parameter in a URL likehttp://en.wikipedia.org/wiki/Talk:Main_Page?action=edit§ion=new&preload=Template:Foo which links to the edit box of a new page, preloaded with Template:Foo.There are also a number of extensions available to trigger your preload file, see below.
The wikitext of the source page is preloaded into the editbox if the page or section does not exist yet.If the page or section to be edited already exists then only its wikitext is loaded, the preload command is ignored.
<noinclude> and</noinclude> tags are removed; if you need the preloaded text to providenoinclude tags, you can use<no<includeonly></includeonly>include>
<noinclude>.<includeonly> and</includeonly> tags are stripped from the source page. If you need the preloaded text to provideincludeonly tags, you can use<include<includeonly></includeonly>only>
<includeonly>.Thus there is neither a complete inclusion nor a regular transclusion.See alsoT7210 (since 2006-03-09).
If it is creating a new section, the initial content of the "Subject/headline" box can be provided with the parameterpreloadtitle
If it is not creating a new section, the summary can be set with the summary parameter.(T19002)
The minor edit checkbox can be set by addingminor parameter
| MediaWiki version: | ≥ 1.23 |
You can also specify parameters to the preload text with thepreloadparams[] url parameter.(When linking on wiki, you may want to escape the[] to be%5b%5d.)At each insertion of theparameter[] in the URL (in order) corresponds a variable, following the numerical order: e.g. the first occurrence replaces the$1 variable, the second$2, and so on.
$1,$2, ... variables are distinct from{{{1}}},{{{2}}}, ... variables.In order to usepreloadparams[], the template should use specifically the$1,$2, ... variables instead of{{{1}}},{{{2}}}, ... parameters, which are not related to thepreloadparams[] feature.
For example:
Extensions that trigger a preload file include:
A few extensions also handle all three steps for you:
All extensions related to page creation are inCategory:Page creation extensions.