Difference between revisions of "Help:Templates"

From Krafties
Jump to navigation Jump to search
m
Line 12: Line 12:
 
===How do I use them===
 
===How do I use them===
 
:When you view the template page itself, you will see a '''Template Explanation''' at the bottom of the page which will explain to you what the specific template is for and what commands work with it
 
:When you view the template page itself, you will see a '''Template Explanation''' at the bottom of the page which will explain to you what the specific template is for and what commands work with it
==How do I find and edit active Templates?==
+
==Finding the Active Templates==
{{Tag|title=Template Control|message=Since ''templates'' play a vital role in the formatting of our ''wiki'', the '''[[WikiWriter]]''' is the only one that should '''create templates and maintain them'''
 
:'''Contributors:''' you are allowed to edit templates for the purpose of correcting spelling errors, adding links, and other details. Please do not change the structure of complex templates unless you absolutely know what you're doing, because these changes effect every wiki-page that are using that template.
 
}}
 
 
[[File:EditingWiki.png|frame|This is how it is when ''editing'' the wiki. Notice the "Templates Used" on the bottom]]
 
[[File:EditingWiki.png|frame|This is how it is when ''editing'' the wiki. Notice the "Templates Used" on the bottom]]
To easily find and edit the active templates within a page:
+
:You can easily find what templates are being used on a page by editing the page and scrolling to the bottom
#Press the "''edit''" button at the top of the page (not edit sections)
+
:*If you click the template link (not the "edit" link) you will find the template itself and the directions how to use it
#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.
+
:*If you are editing a section of page, you will see the Active templates after you preview
#*To see directions/tutorials on how to use specific template, press the Template name.
+
:*The list becomes very long sometimes, because it also lists templates that the template is using.
#*To edit a template used on the page, click the "''edit''" link next to the template name.
+
==Editing Templates (only for Advanced contributors)==
#When editing:
+
:Editing a template is just like editing any other page, but there are certain tags within it that control what content appears only on the template-page itself or when the template is being used. You should not really be messing with the templates themselves unless you are advanced in the wiki coding. '''Remember that you can always "undo" accidents from ''history'''''
#*You will often see <code><nowiki><onlyinclude></nowiki></code>, <code><nowiki><includeonly></nowiki></code> and <code><nowiki><noinclude></nowiki></code> tags at the top of those template pages, '''DO NOT MESS WITH THOSE TAGS'''
+
:*Please be careful when editing templates, because it will effect all the pages that use that template.
#*'''Remember:''' always use ''"Show preview"'' before you save ANY page, to see if it looks correct.  
+
:*Do not mess with the "include" tags, they play a big part in the template functionality.
#*You can always press the "History" and ''undo'' recent changes in case of accidents.
+
:*:<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>===
 
;What are those tags anyway?
 
:They control if content which is placed between them  is displayed when the templates are used on pages.
 
 
{{clear}}
 
{{clear}}
  

Revision as of 07:03, 25 June 2015

Our Wiki Help Pages
General Mediawiki Helpguides

Templates are pretty simple to use once you get the hang of it. They insert content to pages without cluttering it, which is useful for repetitive items. Complex templates can be forms which you can easily fill out when following the directions displayed on the template's page.

What are Templates?

  • Templates are how we format the wiki
  • They can contain table codes, layouts and plain information which is easy to insert wherever needed
  • They add whatever is in the template onto the pages which you place the {{Template}} tag
  • They can also be used like fill-in forms, placing the details into complex tables without the mess
  • Templates are important, in order to have control over layouts and information that are being repeated alot, by simply editing the template and it updates every page which uses that very template.
  • they clear away alot of the clutter which table codes can become

How do I use them

When you view the template page itself, you will see a Template Explanation at the bottom of the page which will explain to you what the specific template is for and what commands work with it

Finding the Active Templates

This is how it is when editing the wiki. Notice the "Templates Used" on the bottom
You can easily find what templates are being used on a page by editing the page and scrolling to the bottom
  • If you click the template link (not the "edit" link) you will find the template itself and the directions how to use it
  • If you are editing a section of page, you will see the Active templates after you preview
  • The list becomes very long sometimes, because it also lists templates that the template is using.

Editing Templates (only for Advanced contributors)

Editing a template is just like editing any other page, but there are certain tags within it that control what content appears only on the template-page itself or when the template is being used. You should not really be messing with the templates themselves unless you are advanced in the wiki coding. Remember that you can always "undo" accidents from history
  • Please be careful when editing templates, because it will effect all the pages that use that template.
  • Do not mess with the "include" tags, they play a big part in the template functionality.
    <onlyinclude> <includeonly> <noinclude>

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