Help:Templates View history

Revision as of 07:27, 15 May 2017 by Kentsmith9 (talk | contribs) (→‎Overview: typo)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
This article covers information on the Waze Wiki itself, not the Waze application. If you reached this page in error, return to the Wiki search page to search again for your topic.


This new page is currently undergoing modifications. Content is being prepared by one or more users. Do not make any changes before you send a private message to this user.

A template is a Wiki page built to be included in other pages and usually contain material intended to be included in many articles or pages throughout the Wiki.

Overview

Templates are usually found in the template namespace. Their page names start with "Template:", such as "Template:red". To add the content of the template page into any other Wiki page, just add the code {{red}} without also including the namespace "Template:".

Although not normally recommended, if a non-Template namespace page must be used as a template, include the namespace like: {{help:editing}} (from the Help namespace) or {{:places}} from the Main namespace).

Template namespace

Learning about templates

Transclusion overview

(Information to be added.)

Documentation subpages

When creating any template, a documentation subpage should be part of the template. Place this code at the very end of the template. Because templates are generally transcluded into other pages, it is important not to add unnecessary line breaks. Therefore the initial <noinclude> should fall immediately after the last character of the template page, not on the next line below it.

<noinclude>

{{Documentation}}
</noinclude>

Once this page is initially added to a template, it will place an empty template documentation box and a red link to the documentation subpage indicating the doc subpage is not yet created. This initial link will automatically enter the template into the category indicating the template documentation is missing.

Once some or all the documentation is added, the category can be changed to reflect the appropriate documentation category if more edits are required, or removed completely since the documentation no longer needs attention.

Adding categories

When adding categories to pages, it is important to differentiate between adding a template to a category or adding the page on which a template is used to a category. In other words, a template that displays a box on a page saying the page is under construction should also add a category onto the page to include it in a category tracking pages under construction. Separately, the template itself should be placed in a category for tracking message templates. Where and how the category link is placed on the page will determine if the page or the template is marked and for what it is marked.

When templates are properly created with a documentation subpage, the category tracking the template itself is put on that document subpage. If a template was originally created without a document subpage, the category may be seen on the template page itself inside noinclude instructions. If that is the case, that code should be removed and the category should be moved to the documentation subpage.

<includeonly><!-- 

  These categories get added only to the template page 
  that transcludes this doc page
  -->
[[Category:Template Management]]
[[Category:Expand Template Documentation]]
</includeonly>