Template:Help:Creating templates

Uit Ashes of Creation Wiki
Naar navigatie springen Naar zoeken springen

Templates are standard wiki pages whose content is designed to be embedded inside other pages. Templates follow a convention that the name is prefixed with "Template:". Besides this, you can create them like any other wiki page.

The simplest use of templates is as follows. If you create a page called "Template:Welcome" with contents:

Hello! Welcome to the wiki.

you'll have created your first template! If you then insert the code:

{{Welcome}}

in any other page, when that page is viewed the text

Hello! Welcome to the wiki.

will appear instead of {{Welcome}}. The template content is "embedded" into the other page.

Suppose it is used in 100 pages. If you then change the template contents to:

Hi there! Welcome to this wonderful wiki.

and revisit any of the 100 pages where the template was used, you'll see the new text instead of the original one. In this way, you have changed the content of 100 pages without editing them, because the template is embedded into these pages.

This is the basic mechanism. There are several additional features that make templates very useful.