Template:CommonData/Rows

The generates repeated wiki code from data results to assist in template maintenance. See also Template: with full information and lists of commands.


 * Usage
 * 1 - category of data
 * 2 - field name to use to match the lookup key
 * 3 - lookup key
 * ... additional 'and' key value lookups, 4 5, 6 7, up to 3 total
 * wiki - wiki code with replaceable values to have transcluded
 * limit - number limit of returned transcluded rows. Default is 800. 0 is all.
 * default - default wiki code if any, to use if no rows are found
 * vars - list of comma separated fields to make variables, without having to mention in 'wiki='
 * istable - if set, enables additional wiki table row and cell markup
 * source - if set, render to wiki code source that can be copy-pasted
 * Returns one transcluded 'wiki code' per row of returned data. If no rows then the result will be empty.

Wiki code replaceable values:
 * These replaceable values look like where they are simply Extension:Variables with the same name as the field who's value you want to substitute. The code in 'wiki=' must be enclosed in 'nowiki' tags to allow the  to get processed later per-row. Also, using a '!' before a name '#var:!name' will skip rendering, but that '#var:name' will still be available for use after/outside the 'Rows' or 'Row' call. Alternatively the 'vars=' parameter can be used to set variables for the same effect, without having to mention the variable in the 'wiki=' parameter at all. All variables created by any of the means above will be available for the rest of the wiki page, or until overwritten.
 * |vars=InstanceID
 * |vars=InstanceID
 * |vars=InstanceID

Wiki code replaceable expressions:
 * These are like the replaceable values from above, but where a supplied expression is used to set the Extension:Variable, and look like . In this case the value of field 'Flags1' will be compared to '0x40000' with a bitwise 'and', and the result of that expression will be set for that var. For binary operators, whitespace around the operator is insignificant for evaluating the expression, including newlines, or may also have no whitespace. However, '#var's with different white space will be treated as different vars. A field name is assumed to be on the left and a literal value on the right. This value cannot be an expression itself because the result will be processed before the code chunk is, in order to make it available for the chunk. These follow the same 'nowiki' rules as above. These also allow using the '!' before the expresson '#var:!expression', which will skip rendering, but that '#var:expression' will still be available for use after/outside the 'Rows' or 'Row' call. As above, all variables created by any of these means will be available for the rest of the wiki page, or until overwritten.
 * - binary operator format
 * - binary operator format
 * - binary operator format

Wiki code 'istable' alternate table cell, row, and wiki tag markup:
 * When 'istable' is enabled, the '^' can be used for table markup with pipes '|' and newlines. This is only necessary when 'wiki=' has wiki table markup that's wrapped by other type markup that use pipes '|', like ' wiki= '. This is an age old wiki problem, but the alternate markup allows it to function in this case.
 * ^- instead of '|-' for a new row. Works without a preceding newline.
 * ^ instead of '|' for a new table cell.
 * ^+ instead of '|', for a new table cell. Works without a preceding newline.
 * ^^ instead of '||' for a new inline table cell.
 * When 'istable' is enabled, escapes with '@' are also available to replace '<' or '>' for any Wiki and Html type tag markup. For 'nowiki' this allows embedding one 'Cd/Rows' inside another, like '|wiki=@nowiki@ stuff @/nowiki@' for the inner 'Cd/Rows'. For other tags like, ,  , it defers processing so that more rows or list elements can be added until final processing. These are also age old 'transcluding' problems, but the alternate markup makes it usable here.
 * @ instead of for a matching nested tag
 * @! instead of for level 2 matching nested tag
 * @!! instead of for level 3 matching nested tag
 * ... and so forth

Wiki 'source' generation of wiki code:
 * Generates source wiki code that can be copy pasted elsewhere, as though the final wiki code had all been typed by hand. This can be used as a regular editable static wiki code version of the data, and can be edited and altered per normal. This allows using CommonData as a raw wiki generator for complex data.
 * 0 - render normally. This is the default.
 * 1 - render as wiki code in a form suitable for copy-paste
 * 2 - render as wiki code for debug, showing augmented code with variables
 * 3 - render as wiki code for debug, but also wrap text to make long lines easier to see


 * Examples

Wiki code on Max Player output

Optional table rows controlled by wiki code

Nested Rows for relating data

Legion Player vs Player

Classic Dungeons, Wiki code on Max Player output

Classic 5, 20,40 Man, Optional rows controlled by wiki code

Nested Rows markup for relating data modules

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 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 would use CommonData to: For #4 these are often excellent candidates for instead wrapping in a template as mentioned in #1.
 * 1) Make or use existing templates to encapsulate CommonData, such as info boxes, that already hide complex wiki code
 * 2) Use CommonData as a tool to generate base static wiki code that a regular contributor could then edit as normal.
 * 3) The contributor simply manually adds static wiki text and code around a 'Cd/Rows' statement, like to amend a table with more rows or to make a longer list or series.
 * 4) Users learn to recognize, as they do for many templates already, the Cd/Rows 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.