Template:Database: Difference between revisions

From Wikishire
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1,946: Line 1,946:
|counterpart=in
|counterpart=in
}}
}}
|Å={{#switch:{{{2}}
|Å={{#switch:{{{2}}}
|name=angstrom
|name=angstrom
|symbol=Å
|symbol=Å
Line 1,957: Line 1,957:
|counterpart=mi
|counterpart=mi
}}
}}
|mi={{#switch:{{{2}}
|mi={{#switch:{{{2}}}
|name=mile
|name=mile
|symbol=mile
|symbol=mile
Line 1,968: Line 1,968:
|counterpart=km
|counterpart=km
}}
}}
|furlong={{#switch:{{{2}}
|furlong={{#switch:{{{2}}}
|name=furlong
|name=furlong
|symbol=furlong
|symbol=furlong
Line 1,979: Line 1,979:
|counterpart=m
|counterpart=m
}}
}}
|chain={{#switch:{{{2}}
|chain={{#switch:{{{2}}}
|name=chain
|name=chain
|symbol=chain
|symbol=chain
Line 1,990: Line 1,990:
|counterpart=m
|counterpart=m
}}
}}
|rod={{#switch:{{{2}}
|rod={{#switch:{{{2}}}
|name=rod
|name=rod
|symbol=rod
|symbol=rod
Line 2,001: Line 2,001:
|counterpart=m
|counterpart=m
}}
}}
|fathom={{#switch:{{{2}}
|fathom={{#switch:{{{2}}}
|name=fathom
|name=fathom
|symbol=fathom
|symbol=fathom
Line 2,012: Line 2,012:
|counterpart=m
|counterpart=m
}}
}}
|yd={{#switch:{{{2}}
|yd={{#switch:{{{2}}}
|name=yard
|name=yard
|symbol=yd
|symbol=yd
Line 2,023: Line 2,023:
|counterpart=m
|counterpart=m
}}
}}
|ft={{#switch:{{{2}}
|ft={{#switch:{{{2}}}
|name=foot
|name=foot
|symbol=ft
|symbol=ft
Line 2,034: Line 2,034:
|counterpart=m
|counterpart=m
}}
}}
|in={{#switch:{{{2}}
|in={{#switch:{{{2}}}
|name=inch
|name=inch
|symbol="
|symbol="
Line 2,045: Line 2,045:
|counterpart=mm
|counterpart=mm
}}
}}
|nmi={{#switch:{{{2}}
|nmi={{#switch:{{{2}}}
|name=nautical mile
|name=nautical mile
|symbol=n mile
|symbol=n mile
Line 2,056: Line 2,056:
|counterpart=km
|counterpart=km
}}
}}
|parsec={{#switch:{{{2}}
|parsec={{#switch:{{{2}}}
|name=pc
|name=pc
|symbol=parsec
|symbol=parsec
Line 2,067: Line 2,067:
|counterpart=light-year
|counterpart=light-year
}}
}}
|ly={{#switch:{{{2}}
|ly={{#switch:{{{2}}}
|name=light-year
|name=light-year
|symbol=ly
|symbol=ly
Line 2,078: Line 2,078:
|counterpart=mi
|counterpart=mi
}}
}}
|astronomical unit={{#switch:{{{2}}
|astronomical unit={{#switch:{{{2}}}
|name=AU
|name=AU
|SI=49,597,870,700
|SI=49,597,870,700

Revision as of 12:51, 10 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.