Wiki Templates: Difference between revisions

From My Wiki
Jump to navigation Jump to search
imported>Tlosk
No edit summary
imported>An Adventurer
(→‎Archive of Internet Article: updated with new 2013 template)
 
(249 intermediate revisions by 8 users not shown)
Line 1: Line 1:
{{RightToC}}
{{RightToC}}
List of wiki templates that are used in formatting areas/items that recur frequently across different pages. Some templates are simple and do not require any parameters while others do. A more [[Wiki Templates#Parameters|complete description]] is given below.
{{Related|Page Templates|Wiki Markup Reference}}
 
List of wiki templates that are used in formatting areas/items that recur frequently across different pages. Their purpose is two-fold, to make using advanced formatting simpler and to allow formatting changes in the future with a single edit (so you don't have to go back and reedit all the pages that use the template). Templates are not only convenient, but they can also "force" a useful uniformity. Some templates are simple and do not require any parameters but most do. If you're new to the term parameter or argument passing in general, a more [[Wiki Templates#Parameters|complete description]] is given below.
 
 
Unlike the templates listed here, [[Page Templates]] are copies of the basic wiki markup code for an entire page and include large areas where unique information is inserted (for example the walkthough on a quest guide). The templates listed here are self-contained, small, and only the specified parameters can be used. Page templates usually contain one or more wiki templates within them, but it is rare for a wiki template to be sufficient to cover the content of an entire page. An analogy would be page templates are like the blue prints of a house, wiki templates are like the lumber and materials, and unique content is like the furniture and people. Also an important technical difference is content using a wiki template looks up the template each time the page is accessed and will reflect the most current version of the template. This is not true for page templates, the content pages do not change if the page template is changed and must be updated manually.
 
 
Note: Wikipedia and many other wikis use lower case or first letter upper case (e.g., "Wiki templates" or "wiki templates") in naming articles, templates, images, etc. However due to the specialized nature of ACC Wiki wherein it holds only content related to Asheron's Call, [http://en.wikipedia.org/wiki/Title_case#Headings_and_publication_titles title case] is the default for naming because that is what is used in game.


== List of Templates ==
== List of Templates ==
''More information for each template can be found by clicking on the template name.''
=== Maps ===
* {{tl|Spawn Map}} - Formats preexisting map of spawn locations. See [[Spawn Map]] for additional information.
* {{tl|Map Point}} - Displays a location on a small map of Dereth given specific coordinates, up to 4 points can be displayed on the same map.
* {{tl|Map Point Plus}} - Displays locations on a large map of Dereth given specific coordinates. The markers on the map can be individually customized for each point, including a popup description which will link to the article of the same name.
* {{tl|Scrolling Map}} - Adds horizontal and vertical scroll bars to an oversize image and displays it within a box that scales to the page to the size specified.
=== Table of Contents ===
=== Table of Contents ===
* [[Template:LeftToC|<nowiki>{{LeftToC}}</nowiki>]] - Table of contents appears on left side with text wrapping along the right.
* {{tl|LeftToC}} - Table of contents appears on left side with text wrapping along the right.
* [[Template:RightToC|<nowiki>{{RightToC}}</nowiki>]] - Table of contents appears on right side with text wrapping along the left.
* {{tl|RightToC}} - Table of contents appears on right side with text wrapping along the left.
* {{tl|Quest Links}} - Placed in quest summary header provides ToC like links to the major sections of a quest writeup.
* {{tl|Exemplar ToC}} - Floats an exemplar image and Table of Contents on the right (text will wrap on the left).


=== Navigation ===
=== Navigation ===
* {{tl|Aerbax's Prodigal Quest Links}} - Links for the Aerbax prodigal quest line.
* {{tl|Announcements Navigation Links}} - Group of links that navigate to next, previous, and all announcements.
* {{tl|Archive Box}} - Compact box of links to pages of archived material.
* {{tl|Armor Links}} - Navigation bar of links to each type of armor.
* {{tl|Currency Links}} - Navigation bar of links to each type of currency.
* {{tl|Consumable Links}} - Navigation bar of links to each type of consumable.
* {{tl|Contract Links}} - Links for viewing contracts by their recommended level categories.
* {{tl|Dungeon Map Links}} - Formats links to the dungeon page, a wiki map, an acmaps.com map, and another website's map for a dungeon.
* {{tl|Elemental Links}} - Link table to the various elemental pages.
* {{tl|Exploration Society Links}} - Navigation bar for Exploration Society quests.
* {{tl|Gameplay Links}} - Links to articles relating to gameplay.
* {{tl|Getting Started Links}} - Links to articles relating to Asheron's Call basics such as character creation and the user interface.
* {{tl|Live Event Navigation Links}} - Table of links for navigating between live events.
* {{tl|Patch Announcements Links}} - Formats links to current, original, and archived pages.
* {{tl|Patch Navigation Links}} - Group of links that navigates to next, previous, and all patches.
* {{tl|Player Character Links}} - Links to articles relating to character advancement.
* {{tl|Quest Pages Links}} - Navigation bar of links to quest directory pages.
* {{tl|Rares Links}} - Navigation bar of links to Rares pages.
* {{tl|Related}} - List of related topics. For one to twenty links.
* {{tl|Skills}} - Table listing of skills by category.
* {{tl|Trophies Creature Links}} - Navigation bar of links to the individual creature type pages.
* {{tl|Weapon Links}} - Navigation bar of links to each type of weapon.
* {{tl|World Links}} - Links to articles relating to elements of the game world.
=== Quotations ===
* {{tl|Turbine Developer}} - Quote block for a Turbine Developer comment.
=== Archive of Internet Article ===
See [[Archive of Internet Article Template]] for an examples.
* {{tl|Turbine 2013}} - Archived internet articles from Turbine's website following the redesign in February 2013 (<nowiki>asheronscall.com</nowiki>)
* {{tl|Turbine 2008}} - Archived internet articles from Turbine's website between the redesigns in August 2008 and February 2013 (<nowiki>ac.turbine.com</nowiki>)
* {{tl|Turbine 2005}} - Archived internet articles from Turbine's website between the redesigns in July 2005 and August 2008 (<nowiki>ac.turbine.com</nowiki>).
* {{tl|Turbine Games}} - Archived internet articles from Turbine's new website between 2003 and the redesign in July 2005  (<nowiki>ac.turbinegames.com</nowiki>).
* {{tl|Microsoft Games Insider}} - Archived internet articles from Microsoft Games (<nowiki>microsoftgamesinsider.com</nowiki>).
* {{tl|Microsoft Games}} - Archived internet articles from Microsoft Games (<nowiki>microsoft.com/games/zone/asheronscall/</nowiki>).
* {{tl|Microsoft Zone}} - Archived internet articles from the Microsoft Zone (<nowiki>zone.com/asheronscall/</nowiki>).
* {{tl|Zogblaster}} - Archived internet articles from Turbine's pre-release pages before Nov 1999 (<nowiki>zogblaster.com/tweb/asherons-call/</nowiki>).
=== Elements ===
Rudimentary components used within many other templates/types of pages.
* {{tl|!}} - Alias for a pipe ( | ) when used within a parameter list for a wiki template.
* {{tl|!-}} - Alias for a pipedash ( |- ) when used within a parameter list for a wiki template.
* <tt>[[Template:=|<nowiki>{{=}}</nowiki>]]</tt> - Alias for an equals sign ( = ).
* {{tl|Icon}} - Displays Icon, enforces [[Naming Conventions]], sets the Icon popup caption to the item name rather than the full image file name, and links the icon itself to the item rather than the icon's image page.
* {{tl|Icon Bullet}} - A bulleted list item showing an icon and a text link to the item. Enforces [[Naming Conventions]], sets the Icon popup caption to the item name rather than the full image file name, and links the icon itself to the item rather than the icon's image page..
* {{tl|Locations}} - Creates a whatlinkshere link for creatures and items, for use in the Notes section.
* {{tl|nobr}} - Format a block of text/images so that they will not line break, useful in tables also.
* {{tl|Notes}} - Superscript links for up to 10 other pages or web addresses. Used at the end of a sentence to refer to supporting materials. [[How To Make Footnotes|Footnotes]] are a more robust solution.
* {{tl|Post}} - Formatting for an individual post with indenting, can be used on talk pages or the [[Forum]].
* {{tl|Sold By}} - Creates a whatlinkshere link for items that are sold by one or more vendors, for use in the Notes section (use even when a single vendor since it will automatically update if more vendors are added in the future).
* {{tl|Strip}} - Remove (trim) leading and trailing white space from a variable.
* {{tl|tl}} - Links to a wiki template showing the name surrounded by curly braces, for use on instructional/help pages.
* {{tl|mtl}} - Nonlink for a wiki template showing the name surrounded by curly braces (used as a parameter that will be turned into a link, such as for {{tl|Related}}.
=== Page Template Related ===
Templates that are designed for use on specific [[Page Templates]].
* {{tl|Ammunition}} - Recipe & Stats panel for arrows, quarrels, darts and other thrown weapons.
* {{tl|Armor}} - Stats panel and live shot for armor (includes clothing, robes, and shields) as part of the [[Armor Template]].
* {{tl|Calculate PXP}} - Widget to calculate xp % of a given level.
* {{tl|Crafter Item}} - Row within a Crafter Table, part of the [[Shopkeeper NPC Template]].
* {{tl|Crafter Table}} - Table of items accepted for xp or items by a Crafter, part of the [[Shopkeeper NPC Template]].
* {{tl|Crafting Recipe}} - Creates a recipe for crafting. Part of the [[Crafting Template]]
* {{tl|Creature}} - Table for individual creature stats. This is a component template and requires additional material for a complete page ([[Creature Template]]).
* {{tl|Creature Class}} - Icon image and link to a creature class.
* {{tl|Dungeon Maps}} - Row within a Dungeon Table, part of the [[Quest Guide Template]].
* {{tl|Dungeon Summary}} - Summary table and live shot as part of the [[Individual Dungeon Template]].
* {{tl|Dungeon Table}} - Table of quest related dungeons and any available maps, part of the [[Quest Guide Template]].
* {{tl|Dyed Variations}} - Template to construct a table to present different dyed variations of armor and clothing.
* {{tl|Food}} - Stats panel, with optional recipe option, for Food & Drinks.
* {{tl|Gem}} - Stats panel and live image as part of the [[Gem Template]].
* {{tl|Healing Kit}} - Stats panel and live shot as part of the [[Healing Kit Template]].
* {{tl|Housing Item}} - Stats panel and live shot as part of the [[Housing Item Template]].
* {{tl|Intro}} - List of patch introduced, related quests, and patches updated.
* {{tl|Item Drops}} - Displays a bulleted list item linking to creatures that drop a particular item, used in the Notes section of of various item sub-category [[Page Template#Items|Templates]].
* {{tl|Item Table}} - Displays a bulleted list of items in a borderless table four across with their icons.
* {{tl|Item Table Three}} - Displays a bulleted list of items in a borderless table three across with their icons.
* {{tl|Item Table Two}} - Displays a bulleted list of items in a borderless table two across with their icons.
* {{tl|Inventory Item}} - An item within an Inventory Table (icon, name and price).
* {{tl|Inventory Table}} - Used on Shopkeeper NPC pages to list the items sold by the shopkeeper (icon, name, and price).
* {{tl|Jewelry}} - Stats panel and live image as part of the [[Jewelry Template]].
* {{tl|Key}} - Stats panel and live image as part of the [[Key Template]].
* {{tl|Magic Caster}} - Stats panel and live image as part of the [[Magic Caster Template]].
* {{tl|Melee Weapon}} - Stats panel and live image as part of the [[Melee Weapon Template]].
* {{tl|Missile Weapon}} - Stats panel and live image as part of the [[Missile Weapon Template]].
* {{tl|MPP Loc}} - A subtemplate that is part of the {{tl|Map Point Plus}} template, calculates the location of coordinates for a point to display.
* {{tl|NPC}} - Stats table and image for a non-player character. This is a component template and requires additional material for a complete page ([[Quest NPC Template]], [[Crafter NPC Template]], [[Shopkeeper NPC Template]], [[NPC Template]]).
* {{tl|NPC Row}} - A single row within an {{tl|NPC Table}} that includes the name, location, type and details for that NPC.
* {{tl|NPC Table}} - NPC Table that includes the name, location, type and details for each NPC. Used in the [[Town Template]] and anywhere a general list of NPCs is desired.
* {{tl|Pet}} - Stats table and image for a player-controlled "pet" creature. This is a component template and requires additional material for a complete page.
* {{tl|Portal Row}} - A single row within a {{tl|Portal Table}} that includes the location, destination, coordinates, and restrictions for that portal.
* {{tl|Portal Table}} - Portal Table that includes the location, destination, coordinates, and restrictions for each Poratl. Used in the [[Town Template]] and anywhere a general list of portals is desired.
* {{tl|Portal Gem}} - Stats panel and live image as part of the [[Portal Gem Template]].
* {{tl|Potion}} - Stats panel and live image as part of the [[Potion Template]].
* {{tl|Recipe Table}} - Creates single steps for recipes. Part of the [[Template:Food]], [[Template:Crafting]] and [[Template:Crafting Recipe]] templates
* {{tl|Quest Experience Table}} - Summary table for the [[Quest Guide Template]].
* {{tl|Quest Summary}} - Summary table and live shot as part of the [[Quest Guide Template]].
* {{tl|Quest Task}} - Single row within the Quest Experience Table, part of the [[Quest Guide Template]].
* {{tl|Sandbox}} - Practice and testing area for new templates.
* {{tl|Settlement}} - Summary table and live shot as part of the [[Housing Settlement Template]].
* {{tl|Shopkeeper Inventory}} - Displays a list of items in a borderless table four across with their icons and prices.
* {{tl|Standard Text}} - Formats a standard text as part of the [[Standard Text Template]].
* {{tl|Title}} - Row within a title rewards table as part of the [[Quest Guide Template]].
* {{tl|Title Rewards Table}} - Title rewards table as part of the [[Quest Guide Template]].
* {{tl|Translated Text}} - Formats a translated text as part of the [[Translated Text Template]].
* {{tl|Vendors}} - (Deprecated, please use {{tl|Sold By}} instead.) <font color=darkgray>Displays a bulleted list item linking to vendors which sell a particular item, used in the Notes section of other Templates.</font>
=== Lore Templates ===
Templates used in various lore pages:
* {{tl|Character Summary}} - Displays a summary of a lore character.
* {{tl|Auberean Index}} - Displays a table of links to topics related to Auberean.
* {{tl|Ispar Index}} - Displays a table of links to topics related to Ispar.
* {{tl|Lore Citation Needed}} - Placed at the top of a page, flags a page for needing references for much or all of its content.
* {{tl|Specific Citation Needed}} - Place after a specific statement to flag that as needing reference.
=== Functions ===
Technically these are not templates, but they are similar in appearance. These modify a string value or perform some operation. A few that are used often in templates are listed below, for a more complete list, see [[Wiki Markup Reference#Magic Words]] and [http://www.mediawiki.org/wiki/Help:Magic_words Help:Magic words].
* <nowiki>{{lc:words}}</nowiki> - Converts the words to all lower case. Useful for allowing case insensitivity in your parameters.
* <nowiki>{{uc:words}}</nowiki> - Converts the words to all upper case.
* <nowiki>{{PAGENAME}}</nowiki> - Returns the name of the page where used. For example if used on this page, would give "Wiki Templates".
=== Image License ===
* {{tl|Promotional image}}
* {{tl|Screenshot}}
* {{tl|Self}}


== Parameters ==
== Parameters ==
A parameter, or argument, is information that the template needs to complete its job. If a parameter is required, you must include it, if it is option you can omit it if it doesn't apply. For example if someone gives you a to do list, the purpose of the list is clear, you are supposed to do the items on the list. But for any given list, the items will differ. A template that requires parameters is the same idea. Separate the parameters with single pipes. Since a to do list can be very long, the template might include 30 option parameters, meaning you could have a list from zero to thirty items long. Here's an example of formatting a to do list with three items using the ToDoList template:
A parameter, or argument, is information that the template needs to complete its job. If a parameter is required, you must include it, if it is optional you can omit it if it doesn't apply. For example if someone gives you a to do list, the purpose of the list is clear, you are supposed to do the items on the list. But for any given list, the items will differ. A template that requires parameters is the same idea. Parameters are separated with single pipes ( | ). If you need to include a pipe as part of a parameter use {{tl|!}}. Here's an example of formatting a to do list with three items using the fictional ToDoList template:


<pre>
<pre>
Line 16: Line 158:
</pre>
</pre>


How the list is formatted will depend on exactly how the actual template was setup, but here is one way it could be set up:
How the list is formatted will depend on exactly how the actual template is setup, but here is one possibility:


<div style="background-color:#E0E0E0; border:2px solid #C0C0C0;width:50%;padding:30px;margin-bottom:20px;margin-left:10%;margin-right:40%;">
<div style="background-color:#E0E0E0; border:2px solid #C0C0C0;width:50%;padding:30px;margin-bottom:20px;margin-left:10%;margin-right:40%;">
Line 25: Line 167:
# Wash car.
# Wash car.
</font></div>
</font></div>
=== Named Variables ===
Unlike the ToDo list above where all the parameters are things to do, most templates that use parameters give each one an explicit name. This is needed when the parameters are formatted differently or put in particular locations.
An example would be a business card template. The phone number, address, name, etc all go in particular locations and so the template needs to know which parameter is the name, which is the address, etc.
For example:
<pre>
{{Business Card
| Name = Martine Strathelar
| Address = 100 Planar Drive, Dereth
| Business = Temporal Translocations
| Phone Number = 555-555-1212
}}
</pre>
which using the hypothetical Business Card template might be displayed as:
<blockquote class="toccolours" style="float:none; padding: 10px 15px 10px 15px; display:table;"><br><big><center>'''''Martine Strathelar'''''</center></big><br><center>'''Temporal Translocations'''</center><br>100 Planar Drive, Dereth - (555)555-1212</blockquote>
=== Whitespace ===
Whitespace (including newlines, tabs and spaces) is stripped from the beginning and end of all parameters. If this is not desirable, adding any non-whitespace characters (including the HTML ''encoding'' for a whitespace character, or invisible Unicode characters such as the zero-width space or direction marks) will prevent further stripping:
:<pre>{{#ifeq: foo            |            foo | equal | not equal }}</pre>
:&rarr; '''{{#ifeq: foo            |            foo | equal | not equal }}'''
:<pre>{{#ifeq: &amp;#32;foo          &amp;#32;|&amp;#32;          foo&amp;#32; | equal | not equal }}</pre>
:&rarr; '''{{#ifeq: &amp;#32; foo          &amp;#32; | &amp;#32;          foo &amp;#32; | equal | not equal }}'''
Judicious use of whitespace can make templates more readable, quicker to fill out, and easier to debug when unexpected behavior occurs. Compare the two uses below that would have identical results.
<pre style="width:auto; overflow:auto">
{{Template
|  Parameter One = One
|  Parameter Two = Two
| Parameter Three = Three
|  Parameter Four = Four
}}
{{Template|Parameter One=One|Parameter Two=Two|Parameter Three=Three|Parameter Four=Four}}
</pre>
==== Strip/Trim ====
Some complicated templates can experience problems with how white space is used when invoking the template (where you would get different results using <nowiki>{{template | variable }} vs. {{template|variable}}</nowiki> even though technically they should be the same. Use the {{tl|Strip}} function around the variable in the template for consistent results.
== Advanced Template Syntax ==
To use templates you won't need to know any of the following, however in order to edit an existing template or to create a new template you may find this information useful. Additional info can be found at [http://meta.wikimedia.org/wiki/Help:Template Help:Template] and [http://meta.wikimedia.org/wiki/Help:Advanced_templates Help:Advanced templates] (Wikipedia, so the information may not always apply exactly to this installation of Wikimedia software). You cannot preview changes to a template, so to avoid having broken templates for other users, test changes or new templates in the [[Template:Sandbox]]. (Don't forget to change your template's name to <nowiki>{{Sandbox}}</nowiki> to see the effects in the Sandbox.) Once it is working how you expect it to, transfer the code to the actual template page and revert the Sandbox.
=== Syntax ===
* '''<nowiki><includeonly></includeonly></nowiki>''' - Optional tags you can place around the workhorse code that defines what the template does. It will cause the code to not display on the template page, improving the appearance of the page since most variables will be undefined. Also it will not compete with an example in situations where only one of an item can be displayed, such as a table of contents.
* '''<nowiki><noinclude></noinclude></nowiki>''' - Anything between these tags will be processed and displayed only when the page is being viewed directly; it will not be included or substituted in normal usage when the template is being referenced.
* '''<nowiki>{{{1}}}</nowiki>''' - The first unnamed variable (parameter) from the template invocation. That is, on another page where <nowiki>{{Related|Weapons|Armor|Loot}}</nowiki> is used, Weapons would be the first unnamed variable. Increment the number for successive variables, for example <nowiki>{{{3}}}</nowiki> would reference the third unnamed variable (Loot). Where this term (<nowiki>{{{1}}}</nowiki>) is used in your template, the variable's value will be inserted. So if <nowiki>[[{{{1}}}]]</nowiki> is in your template, it will be show up as [[Loot]] on the page where you used the template.
* '''<nowiki>{{{1|}}}</nowiki>''' - You can declare a default value for any variable by inserting a pipe and a default value. If the variable is undefined the default value will be given instead. For example, if the template uses <nowiki>{{{1|''No Link''}}}</nowiki> then if no value was passed, it will be assigned "No Link."
* '''<nowiki>{{{Variable}}}</nowiki>''' - A named variable has an explicit name assigned with the equals sign when using the template. For example, on the page using the template you could have <nowiki>{{Business Card|Name=John Doe}}</nowiki>. This would mean that for the template "Business Card" the named variable "Name" has a value of "John Doe" and when using this on the actual template page you would use <nowiki>{{{Name}}}</nowiki> to reference this variable's value (John Doe).
* '''<nowiki>{{{Variable|}}}</nowiki>''' - As described above for <nowiki>{{{1|}}}</nowiki> you can also set a default value for named variables.  This can be useful for templates where you will usually use a standard value but want to retain the option of specifying a value. When using the default, just leave out the variable. For example, <nowiki>{{{align|center}}}</nowiki>. This would still let you set align=right or align=left when using the template, but if you don't use align at all, it will be center. Keep in mind if align is left blank (align = ) then the default will not be used because the value is an empty string. In other words there are three possibilities, in the example below align has a value of "top," margin has an empty value, and style is absent and would use the default value if one is given for the style variable:
<pre>
{{Template
| align = top
| margin =
}}
</pre>
:One way around this that would handle both situations (completely absent and just a blank value) would be to use <code><nowiki>{{#ifeq:{{{align|}}}||<value if absent or blank>|<value if present and nonblank>}}</nowiki></code>. This comparison sets an empty string as the default, so if it is either not present or blank it will lead give the same result.
* '''<nowiki></nowiki>''' -
=== Parser and Variable Functions ===
* '''<nowiki>{{AUTOINRCEMENT}}</nowiki>''' - A variable that increments by 1 each time used, see [[How To Use Autoincrement]].
* '''<nowiki>#if:</nowiki>''' - <nowiki>{{#if: test string | value if true | value if false}}</nowiki>
* '''<nowiki>#ifeq:</nowiki>''' - <nowiki>{{#ifeq: string 1 | string 2 | value if true | value if false}}</nowiki> - Compares string 1 with string 2 to see if they are equal.
* '''<nowiki>#ifexist:</nowiki>''' - <nowiki>{{#ifexist: page title | value if exists | value if doesn't exist }}</nowiki>, can be used for articles or files (images).
* '''<nowiki>#expr:</nowiki>''' - <nowiki>{{#expr: expression }}</nowiki> - Mathematical operations. [http://www.mediawiki.org/wiki/Help:Extension:ParserFunctions#.23expr: Details]
* '''<nowiki>{{PAGESINCATEGORY}}</nowiki>''' - <nowiki>{{PAGESINCATEGORY:Page Name}}</nowiki> - Returns the number of pages in a category. Use <nowiki>{{PAGESINCATEGORY:Page Name|R}}</nowiki> for a number without commas.
* '''<nowiki>#switch:</nowiki>''' - <nowiki>{{#switch:comparison string | case=result | case=result | default result }}</nowiki> - This function compares one input value against several test cases, returning an associated string if a match is found. [http://www.mediawiki.org/wiki/Help:Extension:ParserFunctions#.23switch: Details]
* '''<nowiki>#titleparts:</nowiki>''' - <nowiki>{{#titleparts: pagename | number of segments to return | first segment to return }}</nowiki> - This function separates a pagetitle into segments based on slashes, then returns one or more of those segments as output. [http://www.mediawiki.org/wiki/Help:Extension:ParserFunctions#.23titleparts: Details]
* '''<nowiki>#vardefine</nowiki>''' - <nowiki>{{#vardefine: variablename | value }}</nowiki> - assigns variable, see [[How To Use Variables]].
* '''<nowiki>#vardefineecho</nowiki>''' - <nowiki>{{#vardefineecho: variablename | value }}</nowiki> - assigns and prints variable, see [[How To Use Variables]].
* '''<nowiki>#var</nowiki>''' - <nowiki>{{#var: variablename }}</nowiki> - prints current value, see [[How To Use Variables]].
== Request a Template ==
If you would like a template made but aren't sure how to go about adding one, [[User:Tlosk|Tlosk]] or [[User:Widgeon|Widgeon]] can probably help you.


[[Category:Help]]
[[Category:Help]]
[[Category:Wiki Template]]

Latest revision as of 17:32, 20 February 2013

Related topics: Page Templates, Wiki Markup Reference

List of wiki templates that are used in formatting areas/items that recur frequently across different pages. Their purpose is two-fold, to make using advanced formatting simpler and to allow formatting changes in the future with a single edit (so you don't have to go back and reedit all the pages that use the template). Templates are not only convenient, but they can also "force" a useful uniformity. Some templates are simple and do not require any parameters but most do. If you're new to the term parameter or argument passing in general, a more complete description is given below.


Unlike the templates listed here, Page Templates are copies of the basic wiki markup code for an entire page and include large areas where unique information is inserted (for example the walkthough on a quest guide). The templates listed here are self-contained, small, and only the specified parameters can be used. Page templates usually contain one or more wiki templates within them, but it is rare for a wiki template to be sufficient to cover the content of an entire page. An analogy would be page templates are like the blue prints of a house, wiki templates are like the lumber and materials, and unique content is like the furniture and people. Also an important technical difference is content using a wiki template looks up the template each time the page is accessed and will reflect the most current version of the template. This is not true for page templates, the content pages do not change if the page template is changed and must be updated manually.


Note: Wikipedia and many other wikis use lower case or first letter upper case (e.g., "Wiki templates" or "wiki templates") in naming articles, templates, images, etc. However due to the specialized nature of ACC Wiki wherein it holds only content related to Asheron's Call, title case is the default for naming because that is what is used in game.

List of Templates

More information for each template can be found by clicking on the template name.

Maps

  • {{Spawn Map}} - Formats preexisting map of spawn locations. See Spawn Map for additional information.
  • {{Map Point}} - Displays a location on a small map of Dereth given specific coordinates, up to 4 points can be displayed on the same map.
  • {{Map Point Plus}} - Displays locations on a large map of Dereth given specific coordinates. The markers on the map can be individually customized for each point, including a popup description which will link to the article of the same name.
  • {{Scrolling Map}} - Adds horizontal and vertical scroll bars to an oversize image and displays it within a box that scales to the page to the size specified.

Table of Contents

  • {{LeftToC}} - Table of contents appears on left side with text wrapping along the right.
  • {{RightToC}} - Table of contents appears on right side with text wrapping along the left.
  • {{Quest Links}} - Placed in quest summary header provides ToC like links to the major sections of a quest writeup.
  • {{Exemplar ToC}} - Floats an exemplar image and Table of Contents on the right (text will wrap on the left).

Navigation

Quotations

Archive of Internet Article

See Archive of Internet Article Template for an examples.

  • {{Turbine 2013}} - Archived internet articles from Turbine's website following the redesign in February 2013 (asheronscall.com)
  • {{Turbine 2008}} - Archived internet articles from Turbine's website between the redesigns in August 2008 and February 2013 (ac.turbine.com)
  • {{Turbine 2005}} - Archived internet articles from Turbine's website between the redesigns in July 2005 and August 2008 (ac.turbine.com).
  • {{Turbine Games}} - Archived internet articles from Turbine's new website between 2003 and the redesign in July 2005 (ac.turbinegames.com).
  • {{Microsoft Games Insider}} - Archived internet articles from Microsoft Games (microsoftgamesinsider.com).
  • {{Microsoft Games}} - Archived internet articles from Microsoft Games (microsoft.com/games/zone/asheronscall/).
  • {{Microsoft Zone}} - Archived internet articles from the Microsoft Zone (zone.com/asheronscall/).
  • {{Zogblaster}} - Archived internet articles from Turbine's pre-release pages before Nov 1999 (zogblaster.com/tweb/asherons-call/).

Elements

Rudimentary components used within many other templates/types of pages.

  • {{!}} - Alias for a pipe ( | ) when used within a parameter list for a wiki template.
  • {{!-}} - Alias for a pipedash ( |- ) when used within a parameter list for a wiki template.
  • {{=}} - Alias for an equals sign ( = ).
  • {{Icon}} - Displays Icon, enforces Naming Conventions, sets the Icon popup caption to the item name rather than the full image file name, and links the icon itself to the item rather than the icon's image page.
  • {{Icon Bullet}} - A bulleted list item showing an icon and a text link to the item. Enforces Naming Conventions, sets the Icon popup caption to the item name rather than the full image file name, and links the icon itself to the item rather than the icon's image page..
  • {{Locations}} - Creates a whatlinkshere link for creatures and items, for use in the Notes section.
  • {{nobr}} - Format a block of text/images so that they will not line break, useful in tables also.
  • {{Notes}} - Superscript links for up to 10 other pages or web addresses. Used at the end of a sentence to refer to supporting materials. Footnotes are a more robust solution.
  • {{Post}} - Formatting for an individual post with indenting, can be used on talk pages or the Forum.
  • {{Sold By}} - Creates a whatlinkshere link for items that are sold by one or more vendors, for use in the Notes section (use even when a single vendor since it will automatically update if more vendors are added in the future).
  • {{Strip}} - Remove (trim) leading and trailing white space from a variable.
  • {{tl}} - Links to a wiki template showing the name surrounded by curly braces, for use on instructional/help pages.
  • {{mtl}} - Nonlink for a wiki template showing the name surrounded by curly braces (used as a parameter that will be turned into a link, such as for {{Related}}.

Page Template Related

Templates that are designed for use on specific Page Templates.

Lore Templates

Templates used in various lore pages:

Functions

Technically these are not templates, but they are similar in appearance. These modify a string value or perform some operation. A few that are used often in templates are listed below, for a more complete list, see Wiki Markup Reference#Magic Words and Help:Magic words.

  • {{lc:words}} - Converts the words to all lower case. Useful for allowing case insensitivity in your parameters.
  • {{uc:words}} - Converts the words to all upper case.
  • {{PAGENAME}} - Returns the name of the page where used. For example if used on this page, would give "Wiki Templates".

Image License

Parameters

A parameter, or argument, is information that the template needs to complete its job. If a parameter is required, you must include it, if it is optional you can omit it if it doesn't apply. For example if someone gives you a to do list, the purpose of the list is clear, you are supposed to do the items on the list. But for any given list, the items will differ. A template that requires parameters is the same idea. Parameters are separated with single pipes ( | ). If you need to include a pipe as part of a parameter use {{!}}. Here's an example of formatting a to do list with three items using the fictional ToDoList template:

{{ToDoList|Buy milk.|Return videos.|Wash car.}}

How the list is formatted will depend on exactly how the actual template is setup, but here is one possibility:

To Do List


  1. Buy milk.
  2. Return videos.
  3. Wash car.

Named Variables

Unlike the ToDo list above where all the parameters are things to do, most templates that use parameters give each one an explicit name. This is needed when the parameters are formatted differently or put in particular locations.

An example would be a business card template. The phone number, address, name, etc all go in particular locations and so the template needs to know which parameter is the name, which is the address, etc.

For example:

{{Business Card
| Name = Martine Strathelar
| Address = 100 Planar Drive, Dereth
| Business = Temporal Translocations
| Phone Number = 555-555-1212
}}

which using the hypothetical Business Card template might be displayed as:


Martine Strathelar


Temporal Translocations


100 Planar Drive, Dereth - (555)555-1212

Whitespace

Whitespace (including newlines, tabs and spaces) is stripped from the beginning and end of all parameters. If this is not desirable, adding any non-whitespace characters (including the HTML encoding for a whitespace character, or invisible Unicode characters such as the zero-width space or direction marks) will prevent further stripping:

{{#ifeq: foo            |            foo | equal | not equal }}
equal
{{#ifeq: &#32;foo           &#32;|&#32;           foo&#32; | equal | not equal }}
not equal

Judicious use of whitespace can make templates more readable, quicker to fill out, and easier to debug when unexpected behavior occurs. Compare the two uses below that would have identical results.

{{Template
 |   Parameter One = One
 |   Parameter Two = Two
 | Parameter Three = Three
 |  Parameter Four = Four
}}

{{Template|Parameter One=One|Parameter Two=Two|Parameter Three=Three|Parameter Four=Four}}

Strip/Trim

Some complicated templates can experience problems with how white space is used when invoking the template (where you would get different results using {{template | variable }} vs. {{template|variable}} even though technically they should be the same. Use the {{Strip}} function around the variable in the template for consistent results.

Advanced Template Syntax

To use templates you won't need to know any of the following, however in order to edit an existing template or to create a new template you may find this information useful. Additional info can be found at Help:Template and Help:Advanced templates (Wikipedia, so the information may not always apply exactly to this installation of Wikimedia software). You cannot preview changes to a template, so to avoid having broken templates for other users, test changes or new templates in the Template:Sandbox. (Don't forget to change your template's name to {{Sandbox}} to see the effects in the Sandbox.) Once it is working how you expect it to, transfer the code to the actual template page and revert the Sandbox.

Syntax

  • <includeonly></includeonly> - Optional tags you can place around the workhorse code that defines what the template does. It will cause the code to not display on the template page, improving the appearance of the page since most variables will be undefined. Also it will not compete with an example in situations where only one of an item can be displayed, such as a table of contents.
  • <noinclude></noinclude> - Anything between these tags will be processed and displayed only when the page is being viewed directly; it will not be included or substituted in normal usage when the template is being referenced.
  • {{{1}}} - The first unnamed variable (parameter) from the template invocation. That is, on another page where {{Related|Weapons|Armor|Loot}} is used, Weapons would be the first unnamed variable. Increment the number for successive variables, for example {{{3}}} would reference the third unnamed variable (Loot). Where this term ({{{1}}}) is used in your template, the variable's value will be inserted. So if [[{{{1}}}]] is in your template, it will be show up as Loot on the page where you used the template.
  • {{{1|}}} - You can declare a default value for any variable by inserting a pipe and a default value. If the variable is undefined the default value will be given instead. For example, if the template uses {{{1|''No Link''}}} then if no value was passed, it will be assigned "No Link."
  • {{{Variable}}} - A named variable has an explicit name assigned with the equals sign when using the template. For example, on the page using the template you could have {{Business Card|Name=John Doe}}. This would mean that for the template "Business Card" the named variable "Name" has a value of "John Doe" and when using this on the actual template page you would use {{{Name}}} to reference this variable's value (John Doe).
  • {{{Variable|}}} - As described above for {{{1|}}} you can also set a default value for named variables. This can be useful for templates where you will usually use a standard value but want to retain the option of specifying a value. When using the default, just leave out the variable. For example, {{{align|center}}}. This would still let you set align=right or align=left when using the template, but if you don't use align at all, it will be center. Keep in mind if align is left blank (align = ) then the default will not be used because the value is an empty string. In other words there are three possibilities, in the example below align has a value of "top," margin has an empty value, and style is absent and would use the default value if one is given for the style variable:
{{Template
 | align = top
 | margin = 
}}
One way around this that would handle both situations (completely absent and just a blank value) would be to use {{#ifeq:{{{align|}}}||<value if absent or blank>|<value if present and nonblank>}}. This comparison sets an empty string as the default, so if it is either not present or blank it will lead give the same result.
  • -

Parser and Variable Functions

  • #if: - {{#if: test string | value if true | value if false}}
  • #ifeq: - {{#ifeq: string 1 | string 2 | value if true | value if false}} - Compares string 1 with string 2 to see if they are equal.
  • #ifexist: - {{#ifexist: page title | value if exists | value if doesn't exist }}, can be used for articles or files (images).
  • #expr: - {{#expr: expression }} - Mathematical operations. Details
  • {{PAGESINCATEGORY}} - {{PAGESINCATEGORY:Page Name}} - Returns the number of pages in a category. Use {{PAGESINCATEGORY:Page Name|R}} for a number without commas.
  • #switch: - {{#switch:comparison string | case=result | case=result | default result }} - This function compares one input value against several test cases, returning an associated string if a match is found. Details
  • #titleparts: - {{#titleparts: pagename | number of segments to return | first segment to return }} - This function separates a pagetitle into segments based on slashes, then returns one or more of those segments as output. Details
  • #vardefineecho - {{#vardefineecho: variablename | value }} - assigns and prints variable, see How To Use Variables.

Request a Template

If you would like a template made but aren't sure how to go about adding one, Tlosk or Widgeon can probably help you.