Template:Currency/doc

This is the Currency template.

It provides the functionality for every other in-game currency template of this Wiki in order to provide a consistent apppearance on all pages.

While Currency is normally only called by other templates, it can also be used directly to display currencies on a page, but users may prefer the shorter "first-level" templates listed in the See also section below.

Syntax
The syntax is as follows:

USUS{{ Currency | type = &lt;text1&gt; | &lt;text2&gt; }}lt;text2&gt;lt;text2&gt;

Parameters

 * Text. Any of the following currency names. Not case sensitive, i. e. a8credits instead of A8Credits is also valid. Template calls with an unknown currency type will be displayed with US$a red question mark.
 * A8Coins for Asphalt 8 5th Anniversary event coins
 * A8Credits for Asphalt 8 credits
 * A8HCoins for Asphalt 8 Halloween Festival event coins
 * A8Licenses for Asphalt 8 licenses
 * A8Tokens for Asphalt 8 tokens
 * ANCredits for Asphalt Nitro credits
 * ANTokens for Asphalt Nitro tokens
 * Required. Leaving out  produces an error message.


 * Text. Usually the number that follows the currency icon. Other texts are also accepted.
 * Optional. If no text is provided, a stand-alone currency icon is displayed.

Handling interpreted characters
Templates have problems to handle parameter data that contains equal signs " " or vertical bars " ".

For text that includes an equal sign "=", precede the text with. For example:

Which renders this:
 * US$2 + 2 = 4

For text that includes a vertical bar "|", escape the bar(s) with  or. For instance like this:

Or like this:

Which renders this:
 * USUS{{Currency|type=A8Credits|&#124;2&#124; < 3}}#124;2&#124; < 3#124;2&#124; < 3

Adding future currencies
Currency can easily be expanded for currencies of other Asphalt versions or future events. For example, if an Asphalt 8 event introduces the currency "Newcoins", you can add it by doing the following steps:

Create a new color definition
Go to the Color template and add a new color definition with the same name as your new currency (a8newcoins in our example) by following the instructions in the "Adding new colors" section.

Upload a new currency icon
The filename should ideally be A8newcoins.png or something similar.

Edits in this template
Copy and insert the following line below the  comment in the template: INSERT NEW CURRENCIES BELOW THIS LINE --> | a8newcoins =


 * Name of the currency in lower case. Any upper case combinations will be detected automatically.
 * Filename of the currency icon you have uploaded.
 * Height of the currency icon. Can be left unchanged in most cases.
 * Make sure to edit only the digits between x and px.
 * Caption of the icon that is displayed if the mouse pointer moves over it.
 * Vertical alignment. Can be left unchanged in most cases.
 * Sometimes,  fits better.
 * Pagename the icon links to if clicked.
 * Usually, currencies other than Credits and Tokens don't have their own pages. In this case, the whole parameter can be omitted.

New first-level template
To make it easier for others to use the new currency, a new first-level template named "A8NewCoins" can be created by copying the following line into a new template:

US$

Users can now type  which behaves exactly like  or other currency templates.

Parameters:


 * Name of the currency. Everything else has to be left unchanged.