# Automated Page Creation

Automatic Page Creation can help authors create pages suited to a particular type of content or teaching material.

Image courtesy of olgite

There are a few ways to automate page creation in WikiEducator. We are primarily interested here in the use of an extension to the MediaWiki software (the software that runs WikiEducator, and Wikipedia amongst others) called Inputbox.

The Inputbox extension adds an input field to wiki pages, much like the search box that you see to your left, that enables users to enter the name of a page they would like to create. Submitting this field will automatically create this page and place the user at that page, in the Edit mode (see: Edit mode).

The real power of the Inputbox markup though is that it also enables this newly created page to preload the content of another page into the initial editing area. This is different than the usual way of creating a page by creating a link to a new page then clicking on the link and editing. In the traditional method the newly created page has no pre-existing content; by using Inputbox we can prefill this new page with the content of another already existing page. Most likely this pre-existing page will be a Template page and should be located in the Template namespace, although it does not have to.

## Using the Inputbox extension

To add an Inputbox into a page requires adding the following wikimarkup in the page where you would like the box to appear:

<inputbox>

type=create

editintro=Template:Name_of_Intro_Template

buttonlabel=Create New Content Page

bgcolor=#eeeeff

width=45

</inputbox>

The above wiki markup, if inserted into a page would create an input box that looked like this:

We will explain in more detail each of these attributes and thier variables below.

### type=

For the purpose of these instructions the only attribute we will be discussing is create (for information on creating other types of Inputboxes, see: Extension:Inputbox on the MediaWiki web site.)

Traditionally a new page created in the Wiki is blank and the user fills in whatever content they wish. By using the Infobox extension to create a new page we can pre-fill the page that is created with some already existing content. This can be a handy way to create a sort of template page for users to guide the development of the page by providing headers, and other instructions.

To preload the page created with the Infobox extension add the name of the page you wish to be included after the preload= attribute.

ie. preload=Template:New_accounting_page


This page (in the example above, Template:New_accounting_page) should already exist in the Wiki and it is advantageous that it is created in the Template namespace. This way it is not easily confused with a normal content page. Creating a new page in this namespace requires just adding the Template: part before the name of the page.

### editintro=

Points to a page on the Wiki that will be added before the editing window of the new page created by the Inputbox. A likely use for this option would be to provide some instructions to the user on how to fill in the page. This text will not appear when the user saves the new page. This option can be left out.

ie. editintro=Template:New_accounting_page_instructions


### buttonlabel=

This is the text that will appear on the button for the Input area.

ie. buttonlabel=Create New Accounting Page


Which would result in an Inputbox that would look like this:

### bgcolor = & width=

These two attributes are optional. They add some background colour to the Input box and set the desired width of the text field.

See: http://en.wikipedia.org/wiki/Web_colors for more information on using the hexadecimal system for creating the colours.

### default=

Adding this attribute allows you to create an input box with some default text already entered. This can be useful if you want to create pages within a particular namespace. An example of this can be found on the Practice:Editing page. The inputbox is in this example preloaded with the namespace practice: so that all pages created in this way are grouped accordingly.