Template:ArticleSpawner/doc
{{ArticleSpawner}} helps you create an InputBox that, when used, preloads a new page's edit box with appropriate content, such as an infobox, section headers, content suggestions, and placeholder categories.
If you need more options than a button or infobox, see Widget:ArticleSpawner. |
Usage
{{ArticleSpawner | articleType = | prefix = | editthispage = }}
- articleType
- The type of article. Valid article types should align with available infoboxes actively used on content pages, such as {{Adventure}}, {{Creature}}, {{Biography}}, etc. Each articleType should have a corresponding preload template that exists at Template:ArticleSpawner/(articleType). Note that this is case-sensitive, and articleTypes generally start with capital letters.
- prefix (optional)
- Adds a prefix to the newly created page title, such as a namespace or sub-template.
- editthispage (optional)
- If yes, removes the input box and only shows a button. When clicked, the button loads the articleType into a new edit page using the current page name. This is designed for use in the text shown when creating new pages, such as in MediaWiki:Newarticletext or an articleType's doc page. If you use the default parameter as well, its value overrides the current page as the button's target.
{{ArticleSpawner}} will also pass many InputBox customization parameters: bgcolor, break, buttonlabel, width, default, placeholder, and summary. For help with these parameters, see the InputBox documentation. None of these parameters are required, and the defaults are used for each (except break, which {{ArticleSpawner}} defaults to no.)
Examples
{{ArticleSpawner | articleType = City }}
results in
Entering an article name and clicking the "Create new City" button opens a new edit page with the contents of Template:ArticleSpawner/City preloaded in the edit box, and the contents of Template:ArticleSpawner/City/doc appearing above the edit box.
You can customize some elements of your {{ArticleSpawner}}:
{{ArticleSpawner | articleType = City | bgcolor = #363 | width = 20 | placeholder = Enter city name here | summary = New city article | break = yes }}
results in
Note that the width, background color, placeholder text, and line break are different.
Finally, to show a button that edits the current page (ideal for use on new pages, as in the MediaWiki:Newarticletext):
{{ArticleSpawner | editthispage = yes | articleType = Book | buttonlabel = Book }}
results in
Creating new article types
Creating a new article type for use with {{ArticleSpawner}} is easy!
- Create a new page at Template:ArticleSpawner/articleType. For instance, to create an articleType for Dice set, create a page at Template:ArticleSpawner/Dice set.
- On this new page, enter the wikitext you'd want to see preloaded in the edit box when creating a new article of that type with an {{ArticleSpawner}}. This can be infobox templates, section headers, categories, and anything else that you'd put on a new article of that type. To add notes for editors inside the wikitext, use HTML comments (<!-- text wrapped like this -->).
- Wrap all content on the preload template page with a <includeonly> tag at the very top and a </includeonly> tag at the very bottom. This prevents the template page itself from showing up in categories, including any autocategorized categories applied by things like infobox templates. (Don't worry—the <includeonly> tags themselves won't show up in the preloaded text. If you want <includeonly> or <noinclude> tags to show up, break them up with <includeonly> tags that have nothing between them: <no</includeonly><includeonly>include>. The <includeonly> tags will disappear during prepopulation, leaving only the <noinclude> tag.)
- (Optional) To show a custom editing guide above the edit box, create a page at Template:ArticleSpawner/articleType/doc. It helps to keep this documentation short so the editing box is easily accessible; see Template:ArticleSpawner/City/doc for an example that uses a {{Userbox}} and content from a Help page.
That's it! You can now create an {{ArticleSpawner}} that uses your articleType as a parameter; in this example, {{ArticleSpawner|articleType=Dice set}} would now work.