Template:Database: Difference between revisions

From Wikishire
Jump to navigation Jump to search
Further units added
RB (talk | contribs)
mNo edit summary
Line 41: Line 41:
|County Antrim={{#switch:{{{2}}}
|County Antrim={{#switch:{{{2}}}
|name=County Antrim
|name=County Antrim
|Welsh=
|Welsh=Swydd Antrim
|sort=Antrim
|sort=Antrim
|type=county
|type=county
Line 47: Line 47:
|area=1175
|area=1175
|flag=
|flag=
|badge=
|badge=Antrim arms.svg
|Chapman code=ANT
|Chapman code=ANT
|HCS code=ANM
|HCS code=ANM
Line 68: Line 68:
|County Armagh={{#switch:{{{2}}}
|County Armagh={{#switch:{{{2}}}
|name=County Armagh
|name=County Armagh
|Welsh=
|Welsh=Swydd Armagh
|sort=Armagh
|sort=Armagh
|type=county
|type=county
Line 74: Line 74:
|area=512
|area=512
|flag=
|flag=
|badge=
|badge=Armagh arms.svg
|Chapman code=ARM
|Chapman code=ARM
|HCS code=ARH
|HCS code=ARH
Line 688: Line 688:
|area=816
|area=816
|flag=
|flag=
|badge=
|badge=Lderry arms.svg
|Chapman code=LDY
|Chapman code=LDY
|HCS code=LDR
|HCS code=LDR
Line 1,104: Line 1,104:
|area=1260
|area=1260
|flag=
|flag=
|badge=
|badge=Tyrone arms.svg
|Chapman code=TYR
|Chapman code=TYR
|HCS code=TYN
|HCS code=TYN

Revision as of 12:43, 24 October 2012

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.