Template:Database: Difference between revisions

From Wikishire
Jump to navigation Jump to search
RB (talk | contribs)
Flintshire flag
RB (talk | contribs)
Caernarfonshire flag
Line 191: Line 191:
|county town=Caernarfonshire
|county town=Caernarfonshire
|area=563
|area=563
|flag=Flag of Caernarfonshire.png
|flag=Flag of Caernarfonshire.svg
|badge=Flag of Caernarfonshire.png
|badge=Flag of Caernarfonshire.svg
|Chapman code=CAE
|Chapman code=CAE
|HCS code=CRN
|HCS code=CRN

Revision as of 16:06, 11 July 2015

Template:Database is a general database constructed as the Mediawiki programme permits, as nested switch functions. The data may be extracted easily whether within an article or in a template.

The database contains counties, territories etc, but also units of measurement, which feed the "Convert" function of Template:Convert.

Examples

The following examples demonstrate how to extract data:

[[File:{{Database|Monmouthshire|flag}}|center|50px]] will give:
{{Database|Monmouthshire|Welsh}} will give: Sir Fynwy

Caution: blank fields

Not every data field is completed nor can be. Care must therefore be taken to ensure that you still achieve the right result in every case.

The first example above but substituting "Ayrshire" in place of "Monmouthshire" would produce an error as there is no Ayrshire flag image, so an {{:if: or {{:ifeq: function should be used where there might be a blank field.