Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Editing Battlestar Wiki:Template List Guidelines

From the only original and legitimate Battlestar Wiki: the free-as-in-beer, non-corporate, open-content encyclopedia, analytical reference, and episode guide on all things Battlestar Galactica. Accept neither subpar substitutes nor subpar clones.
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision Your text
Line 6: Line 6:
== Template Syntax ==
== Template Syntax ==


When you create most templates you can just have them posted. Some don't have any options. but others have tons of options (i.e. {{tl|cite web}}). But as soon as you get complicated templates with lots of options, it is best to keep the syntax simple and easy to understand if you ever had to do any templates. Some of them have options that are only needed on certain pages and some things on a template should only be on the template. This pages is to tell you how to do that.
When you create most templates you can just have them posted. Some don't have any options. but others have tons of options (i.e. {{tl|cite web}}). But as soon as you get complicated templates with lots of options, it is best to keep the syntax simple and easy to understand if you ever had to do any templates. Some of them have options that are only needed on certain pages and some things on a template should only be on the template. This pages is to tell you haow to do that.


A few things you know first is that there are a few template related syntax HTML tags that you should know before going any futures.
A few things you know first is that there are a few template related syntax HTML tags that you should know before going any futures.
Line 15: Line 15:
** Any '''code/text''' in between these tags will only be processed in the template page itself and never will be passed on when rendered.
** Any '''code/text''' in between these tags will only be processed in the template page itself and never will be passed on when rendered.


== [http://meta.wikimedia.org/wiki/ParserFunctions ParserFunctions] ==
== <nowiki>{{qif}}</nowiki> v. [http://meta.wikimedia.org/wiki/ParserFunctions ParserFunctions] ==


Using [http://meta.wikimedia.org/wiki/ParserFunctions ParserFunctions] is the only way to do comparisons. [[:Category:Mathematical templates|Mathematical templates]] have been imported from ''Wikipedia'' to help with complex math operations in template. if you use any of the [http://meta.wikimedia.org/wiki/ParserFunctions ParserFunctions] in any part, please add '''<nowiki><noinclude>[[Category:Templates using ParserFunctions|{{PAGENAME}}]]</noinclude></nowiki>''' to document the templates that are using this template.
The template <nowiki>{{qif}}</nowiki> is now gone. Using [http://meta.wikimedia.org/wiki/ParserFunctions ParserFunctions] is the only way to do comparisons.
 
== Live Example ==
The best example on this Wiki is the {{tl|cite web}} template as it's very complex. If you view the template why you read it would be good so you can compare on what stuff does.
 
=== Part 1: Code ===
Has the actual template code. It is all increased with '''<nowiki><includeonly></nowiki>''' because there are required options for the template and if it was formated, it would return an error and we don't need to show that to a user who is trying to see how to use a template.
 
=== Part 2: Documentation ===
 
States the general purpose of the said template and how it should be used and where it should be used.
 
=== Part 3: Full Syntax Use ===
 
Should be how to use the template fully, no matter what the options are so the user knows what options are needed. In this should also carry the minimum section always showing the user what are the minimum fields required for use so the user can copy the syntax and paste it where they needed. Another section should be a "most common" fields that are used for the template.
 
=== Part 4: Explain the fields ===
 
Though this is the most section, this section should have two subparts. '''Required''' and '''Optional''' parts. Other parts might exist if they might seem to the relevant template. ''See {{tl|Episode Data}} for a perfect example.''
 
This section should be filled out like this:
 
<div style="font-size: 90%;">
* '''parent'''
** '''child''' &mdash; may be used '''with''' ''parent'' (and is ignored if ''parent'' is not used)
** OR:  '''child2''' &mdash; may be used '''instead''' of ''parent'' (and is ignored if ''parent'' is used)
*** AND: '''child3''' &mdash; may be used '''with''' ''parent'' and ''child'' (ignored if not filled out)
</div>
 
If the field name is '''bold''', this is usually a field that is required, but if it is ''italicized'' it's a description of the child fields. '''OR''' means that it can be used but not required. '''AND''' means that the field is needed in addition to it's parent in the list.
 
==== Required ====
 
This section has to at least exist. There is no excuse for this not to exists.
 
==== Optional ====
 
This section is for the optional fields.
 
=== <nowiki><noinclude></nowiki> ===
 
Parts 2 - 4 have the <nowiki><noinclude></nowiki> encased in them so they will not show up when the template is rendered.
 
== Subst: templates ==
 
All templates that are supposed to be <code>subst:</code> should have '''<nowiki><noinclude></nowiki>{{tl|TemplateSubst}}<nowiki></noinclude></nowiki>''' to display any user that the template ''has'' to be subst: because it's not a common template and it really doesn't need to be updated once it's added. (i.e. The day can change.)
 
[[fr:Battlestar Wiki:Manuel (Modèles)]]

To edit this page, please enter the words that appear below in the box (more info):

Refresh
Cancel Editing help (opens in new window)

  [] · [[]] · [[|]] · {{}} · · “” ‘’ «» ‹› „“ ‚‘ · ~ | ° &nbsp; · ± × ÷ ² ³ ½ · §
     [[Category:]] · [[:File:]] · [[Special:MyLanguage/]] · <code></code> · <nowiki></nowiki> <code><nowiki></nowiki></code> · <syntaxhighlight></syntaxhighlight> · <includeonly></includeonly> · <noinclude></noinclude> · #REDIRECT[[]] · <translate></translate> · <languages/> · {{#translation:}} · <tvar|></> · {{DEFAULTSORT:}} · <categorytree></categorytree> · <div style="clear:both;"></div> <s></s>


Your changes will be visible immediately.
  • For testing, please use the sandbox instead.
  • On talk pages, please sign your comment by typing four tildes (~~~~).

Template used on this page: