Template:CommonData

The template aggregates and looks up game information to assist in template mantenence. This is the main template for common data, and all related templates are sub-templates of this template. See also Category: Templates.


 * Usage
 * 1 - category of data
 * 2 - field name to use to match the lookup key
 * 3 - lookup key
 * 4 - output field name to return a value from
 * default - default wiki code if any, to use if no value is found
 * Returns the value of the output field for the lookup key

Other commands
 * Template:/Rows - Generate repeated wiki text from data.
 * Template:/Row - Generate single wiki text from data.
 * Template:/Joins - Generate repeated wiki text from multiple data sources.
 * Template:/Join - Generate single wiki text from multiple data sources.
 * Template:/IsFlag - A bitwise all flags type for data values test.
 * Template:/AnyFlag - A bitwise any flags type for data values test.
 * Module:|GetRowValue - Same as this template but with module semantics.
 * Module:|GetRows - Same as 'Cd/Rows' but with module semantics.
 * Module:|GetRow - Same as 'Cd/Row' but with module semantics.
 * Module:|GetJoins - Same as 'Cd/Joins' but with module semantics.
 * Module:|GetJoin - Same as 'Cd/Join' but with module semantics.
 * Module:/Bit|IsFlag - Same as 'Cd/IsFlag' but with module semantics.
 * Module:/Bit|AnyFlag - Same as 'Cd/AnyFlag' but with module semantics.
 * Module:/Bit|band - Bitwise 'and'. See IsFlag.
 * Module:/Bit|bor - Bitwise 'or'. See IsFlag.
 * Module:/Bit|bxor - Bitwise 'xor'. See IsFlag.


 * Examples


 * &rarr;
 * &rarr;
 * &rarr;
 * &rarr;
 * &rarr;

This template could be renamed however it would be better to create a redirect alias due to all of the interconnects between the templates and modules. Redirect names such as or  are a good choices if not already taken.
 * For Admins and Maintainers

Some of the wiki coding style needed to generate the more complex lookups would be difficult for most casual wiki contributors. In these cases the intent is that admins and maintainers could: For #3 these are often excellent candidates for instead wrapping in a template as mentioned in #1.
 * 1) Use templates to encapsulate CommonData to hide complex wiki code, as usual.
 * 2) Allow the contributor to simply add static wiki text and code around a 'Cd' statement.
 * 3) Help users learn to recognize, as they do for many templates already, the 'Cd' idioms that can be copy/pasted where they only need to change a name, a number, or some other static text inside the Cd/Rows call to get the effect they want.

CommonData templates and files:
 * Template: - This template.
 * Template:/Rows - Rows processing template.
 * Template:/Row - Row processing template.
 * Template:/Joins - Rows join processing template.
 * Template:/Join - Row join processing template.
 * Template:/View - Whole data set view processing template.
 * Template:/Test - Scratch pad test template. Use to test or build wiki text.
 * Template:/IsFlag - Test if number bits match all bits of another.
 * Template:/AnyFlag - Test if number bits match any bits of another.
 * Module: - Base module.
 * Module:/Bit - Small version of Lua 'bit' library as module.
 * Module:/Row - Data lookup module. Invoke should use Module:.
 * Module:/Join - Join data lookup module. Invoke should use Module:.

These are wiki's current data modules:
 * Module:/Instances - Data module for Instances. Update as needed.
 * Module:/Areas - Data module for Areas. Update as needed.
 * Module:/Maps - Data module for Maps. Update as needed.

The lack of '/doc' files for template documentation is on purpose for this utility, and was done in order to make it easier to copy, rename, and to simplify file compares and updates between sites for maintenance.