Help:Templates

From Support Wiki
Jump to navigation Jump to search

Summary

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 and various number of custom templates like DiscordCompact / DiscordWidget.

Related:

Manual

Start

First start by setting up your template documentation pre-made templates. This will be needed for our {{Documentation}} template that is 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 wikis 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.