Templates
See Help:Templates on mediawiki.org for more information.
Templates are used for various functionality from organizing the main page of a wiki to inserting data. Content that uses templates range from infoboxes, navigation boxes, and licenses, along with various custom templates like DiscordCompact and DiscordWidget.
Manual
Start
First start by setting up your template documentation pre-made template. This {{Documentation}}
template will be used on all templates. To create a new template, click "New page" from the sidebar, select "Template" from the dropdown, then enter the name and click Create. Alternatively, place {{ExampleName}}
on your article, then click on the red link with the text Template:ExampleName
.
Template
Let's start by creating a simple template that places the wiki's game name as a hyperlink. Follow the instructions above to create the template page, and name the template Gamename
. Next, place this syntax into your template, replace "Game Name" with the wiki's game, and press "Save page."
<includeonly>[[Game Name]]</includeonly><noinclude>{{Documentation}}[[Category:Templates]]</noinclude>
Output
As seen in our test template that you created. We originally had
MP5 is a [[Weapons|weapon]] featured in [[Game 1]].
Now we can replace Game 1 with
MP5 is a [[Weapons|weapon]] featured in {{Gamename}}.
Doc template
Now head to {{ExampleName/doc}}
or Template:ExampleName/doc
and create a documation template.
This template places the game name {{Gamename}} as a hyperlink for article pages. <noinclude>[[Category:Template documentation|{{PAGENAME}}]]</noinclude>
Finally visit the main template and purge the article (Template:ExampleName?action=purge
) so that the documentation can show.