Difference between revisions of "Help:Templates"

From Krafties
Jump to navigation Jump to search
 
(17 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{WikiHelp}}
+
{{WikiHelp}} {{TOC none}}
 +
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.
 +
[[File:EditingWiki.png|frame|This is how it is when ''editing'' the wiki. Notice the "Templates Used" on the bottom]]
  
 
==What are Templates?==
 
==What are Templates?==
*Templates are used on wikis to add content and codes to pages, by simpling adding a '''<code>{{[[:Category:Templates|Template]]}}</code>''', 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.
+
*Templates make formatting the wiki easier
*This frees the page of repetitive information or complex codes cluttering when you are editing a page.
+
*They can contain table codes, layouts and plain information which is easy to insert wherever needed
*This also makes it easier to update information that is repeated on multiple pages, by simply updating the template containing the information.
+
*They add whatever is in the template onto the pages which you place the <code><nowiki>{{Template}}</nowiki></code> 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 edit the Templates?==
+
===How do I use them===
{{Tag|Template Control|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'''
+
: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
:'''Contributors:''' you are allowed to edit templates for the purpose of '''correcting''', such as spelling errors, wrong links, and other details
+
==How can I see what templates are being used?==
}}
+
:You can always find what templates are currently in use on a page when editing.
 +
:*If you are editing a section (instead of entire page at once) all you need to do is press ''"Show Preview"''' and the list of templates will appear if any
 +
:*Just press the link to the template you wish to view, there you should be able to find a guide on how to use the more complex templates
 +
:*Be aware that even if only a single template is being used, the tempate list can appear longer. This is because it will also count the templates within the template being used.
 +
==How can I tell if any page is using the template?==
 +
:You can see what pages are using a template the same way as you can see if any page is being linked to
 +
:*In the sidebar here on the left you can see a link "What links here"
 +
:*When on template pages, it will list what pages are using that very template.
  
To easily find and edit the active templates within a page:
 
#Press the "''edit''" button at the top of the page
 
#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 <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'''
 
#'''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.
 
  
===What are those tags anyway? <code><nowiki><onlyinclude></nowiki></code> <code><nowiki><includeonly></nowiki></code> <code><nowiki><noinclude></nowiki></code>===
+
==Editing Templates (only for Advanced contributors)==
*They control if content which is placed between them  is displayed when the templates are used on pages.
+
: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.
==Using Templates==
+
:*Do not mess with the "include" tags, they play a big part in the template functionality.
{| style="width:70%"
+
:*:<code><nowiki><onlyinclude></nowiki></code> = include this on pages
|
+
:*:<code><nowiki><includeonly></nowiki></code> = only include this on pages (does not appear on the template page itself)
{{TemplateExplanation|
+
:*:<code><nowiki><noinclude></nowiki></code> = exclude this from appearing on pages
On each template's page are explanations for how to use that specific template, in a box like this.  
+
{{clear}}
:*Many templates let you add content to it by filling it in the right order within the tag:
 
::'''example:''' the <code><nowiki>{{yes}}</nowiki></code> is specifically made to be used within table cells (else it looks like plain code).
 
}}
 
{| class=wikitable
 
!colspan=3|Using templates (with <code><nowiki>{{yes}}</nowiki></code> template as example)
 
|-
 
!Description !!Code !! Results
 
|-
 
|Plain use of template, fills the cell with color and "yes" ||<code><nowiki>{{yes}}</nowiki></code> ||{{yes}}
 
|-
 
|Adding text to template, in this case it will replace the default text. ||<code><nowiki>{{yes|usually}}</nowiki></code>|| {{yes|usually}}
 
|}
 
:If you would use this template outside of its designated usage (which is within table cells), it turns out looking like this:
 
:*{{yes}}
 
 
 
 
 
|}
 

Latest revision as of 17:27, 1 May 2017

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.

This is how it is when editing the wiki. Notice the "Templates Used" on the bottom

What are Templates?[edit]

  • Templates make formatting the wiki easier
  • 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[edit]

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 can I see what templates are being used?[edit]

You can always find what templates are currently in use on a page when editing.
  • If you are editing a section (instead of entire page at once) all you need to do is press "Show Preview"' and the list of templates will appear if any
  • Just press the link to the template you wish to view, there you should be able to find a guide on how to use the more complex templates
  • Be aware that even if only a single template is being used, the tempate list can appear longer. This is because it will also count the templates within the template being used.

How can I tell if any page is using the template?[edit]

You can see what pages are using a template the same way as you can see if any page is being linked to
  • In the sidebar here on the left you can see a link "What links here"
  • When on template pages, it will list what pages are using that very template.


Editing Templates (only for Advanced contributors)[edit]

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> = include this on pages
    <includeonly> = only include this on pages (does not appear on the template page itself)
    <noinclude> = exclude this from appearing on pages