Difference between revisions of "Help:Templates"

From Krafties
Jump to navigation Jump to search
Line 19: Line 19:
 
#*You can always press the "History" and ''undo'' recent changes in case of accidents.
 
#*You can always press the "History" and ''undo'' recent changes in case of accidents.
  
===What are those tags anyway? <code><nowiki><onlyinclude></nowiki></code> <code><nowiki><includeonly></nowiki></code> <code><nowiki><noinclude></nowiki></code>===
+
===<code><nowiki><onlyinclude></nowiki></code> <code><nowiki><includeonly></nowiki></code> <code><nowiki><noinclude></nowiki></code>===
*They control if content which is placed between them  is displayed when the templates are used on pages.
+
;What are those tags anyway?
 +
:They control if content which is placed between them  is displayed when the templates are used on pages.
  
 
==Using Templates==
 
==Using Templates==

Revision as of 08:22, 17 August 2014

Our Wiki Help Pages
General Mediawiki Helpguides

What are Templates?

  • Templates are used on wikis to add content and codes to pages, by simpling adding a {{Template}}, which will display the template's content as part of the wiki-page when viewed, while only actually being a short template-tag when you are editing the page.
  • This frees the page of repetitive information or complex codes cluttering when you are editing a page.
  • This also makes it easier to update information that is repeated on multiple pages, by simply updating the template containing the information.

How do I edit the Templates?

To easily find and edit the active templates within a page:

  1. Press the "edit" button at the top of the page
  2. Scroll down to the bottom, below the text-editing area, there you will see a list of templates currently in use on the page, and a easy "edit" button next to each link.
    • When you press the "edit" link next to the template name, you will be taken to the content of that template.
    • You will often see <onlyinclude>, <includeonly> and <noinclude> tags at the top of those template pages, DO NOT MESS WITH THOSE TAGS
  3. Remember: always use "Show preview" before you save ANY page, to see if it looks correct.
    • You can always press the "History" and undo recent changes in case of accidents.

<onlyinclude> <includeonly> <noinclude>

What are those tags anyway?
They control if content which is placed between them is displayed when the templates are used on pages.

Using Templates

Documentation

Template:Templates/doc

The above documentation is transcluded from Help:Templates/doc.
Editors can experiment in this template's sandbox
Please add categories to the /doc subpage within <includeonly>...</includeonly>
Using templates (with {{yes}} template as example)
Description Code Results
Plain use of template, fills the cell with color and "yes" {{yes}} Yes
Adding text to template, in this case it will replace the default text. {{yes|usually}} usually
If you would use this template outside of its designated usage (which is within table cells), it turns out looking like this:
  • style="background:#9F9;vertical-align:middle;text-align:center;" class="table-yes"|Yes