User:Mtew/Account vault/Cell Template
The Code as an simple Example[edit]
Philosophy[edit]
This template is more complex than it has to be. In general, each component of its output can be specified by a keyword parameter so detailed control is available, but those parameter values have defaults based on the positional parameter 'name's value for simplicity. In many cases, that control has provided methods for solving problems, while other controls have not yet been used. Some people consider this kind of anticipation un-justified. A message to those people: Until experience has shown which parameters are useful — Hands off.
The use of variables may also be contraversial. Their use provides ways to assure that the formatting of a page can be controlled by one specifications. Their use may confuse new editors, but that consistancy is very valuable, and the use of variables is a powerful technique that editors would do well to learn.
Usage[edit]
This template has one positional parameter, several keyword parameters and references '#var' definitions.
Positional Parameters[edit]
name (optional)[edit]
This parameter provides the basis for default values of the keyword parameters.
If omitted, it is taken to mean that the cell is under construction and appropriate default for that situation are provided.
Practical note: This parameter is usually provided.
modifier keyword: name prefix (optional)[edit]
This keyword parameter is optional and is usually omitted.
Its value is prefixed to the 'name' parameter's value in Image and Link construction contexts.
If the '#var:Vault Cell Default name prefix' is set, its value is used as the default value for this parameter. Otherwise, the value of this parameter is 'null'. (That is no prefixing takes place.
Practical note: This parameter is not used explicitly, but the entire 'Mini-pet' panel uses the '#var:Vault Cell Default name prefix'.
Key Word Parameters[edit]
image (optional)[edit]
This parameter is optional and is usually omitted.
If provided, it is prefixed by the value of '#var:Vault Cell image prefix'. If not provided, it defaults to the value of 'name' prefixed by the value of 'name prefix' and suffixed by the value of 'ext'.
Practical note: This parameter is particularly useful where the icon image has been located but the item's name is unknown.
modifier: ext[edit]
This parameter is optional and is usually omitted.
If the '#var:Vault Cell Default ext' is defined, its value is used as the default value for this parameter. If that variable is not defined, the default value '.png' is used.
This value is not used if both the 'image' keyword and 'name' positional parameters are omitted.
Practical note: This parameter is not used explictly, nor is its associated variable's value, but its ultimate default value is necessary.
size (optional)[edit]
This parameter is optional and is usually omitted.
This parameter determines the size of the image displayed and the lenght of the caption beneath the image. Both sizes are in 'px'.
If the '#var:Vault Cell Default size' is defined, its value is used as the default value for this parameter. If that variable is not defined, the default value '64' is used.
Design note: Investigate the use of 'em' in place of 'px' to provide resolution independent sizing. 'pt' is known to not work.
Practical note: This parameter is not currently used but the associated variable '#var:Vault Cell Default size' is used on most pages.
tip (optional)[edit]
This parameter is optional and is usually omitted.
This parameter provides the content of the roll-over drop-down box (a.k.a. a 'tool tip').
If this parameter is not specified, the value of 'name' is used. If neither parameter is provided, 'TBS' (To Be Supplied/Specified/whatever) is used.
Design note: This needs work. Idealy it should duplicate the in-game drop-down which contains a full color, reduced size copy of the image, the 'name' of the item and, if appropriate, the standard selling price of the item.
Practical note: Currently, no instance specifies this parameter.
modifier: value[edit]
This parameter is optional and is usually omitted.
This parameter provides a suffix to the 'tip' that specifies the merchant's buy price for the item.
Design note: This information should be extracted from the value parameter of the object's infobox on the linked page.
link (optional)[edit]
This parameter is optional and is usually omitted.
This parameter's value provide the name of the 'linked to' page. If not provided, the effective value of 'name prefix' prefixed to 'name' is used. The value is suffixed with the value of the 'link suffix' parameter.
If neither 'link' nor 'name' is provided, the link goes to 'Under construction'.
modifier: link suffix[edit]
This parameter is optional and is usually omitted.
The value of this parameter is suffixed to the effective value of the 'link' parameter.
If this parameter is not provided, the value of '#var:Vault Cell Default link suffix' is used.
Design note: Seriously consider removing this parameter and its associated variable.
[edit]
This parameter is optional.
The value of this parameter is displayed in <small> text below the icon. The main use of this parameter is to cram a modified form of 'name' into the space provided by the width of the icon.
Design problem: The vertical spacing between broken lines is too large.
Practical note: This parameter has been very useful.
'#var:'s used[edit]
Vault Cell image prefix[edit]
This variable's value, if specified, prefixes the effective value of the keyword 'image'.
It is very useful when a this template used in a User Space context where it can shift the location of the images being tested.
Vault Cell Default name prefix[edit]
This variable's value specifies the default value for the keyword parameter 'name prefix'. If not set, it has an effective value of 'null'. Normally its value is not set.
Its primary use is to modify the value 'name'. For example, all the names on the Mini Pet page should be prefixed with 'Mini_' when used to reference images or articles. This can be accomplished by including {{#vardefine:Vault Cell Default name prefix|Mini_}} someplace before this template is used.
It may also be useful during testing to shift images and links away form the main name space.
Design note: It may be necessary to split this into two variables, one for images and another for links.
Vault Cell Default ext[edit]
This variable's value specifies the default value of the keyword parameter 'ext'. If not set, it has the effetive value of '.png'. Normally its value is not set.
Vault Cell Default size[edit]
This variable's value specifies the default value of the keyword parameter 'size'. If not set, it has the effective value of '64x64px' Normally its value is not set, but is used on the 'mini-pet' page because mini-pet icons are usually larger than normal icons.
Vault Cell Default link suffix[edit]
This variable's value specifies the default value of the keyword parameter 'link suffix'. If not set, it has no effectuve value; Normally its value is not set.