Difference between revisions of "Template:Map caption"
imported>Kukini m (Reverted edits by 200.44.156.157 (talk) to last version by SomeHuman) |
|||
| Line 1: | Line 1: | ||
| − | <div style=" | + | <noinclude>{{Intricate}} |
| − | < | + | <div style="width:100%;text-align:center;font-size:9px;line-height:1.2em;"><div style="width:80%;background-color:#808080;color:#ffffff;text-align:center;">template output (without input parameters) start</div></div></noinclude><!-- |
| − | |||
| − | < | + | --><div style="text-align:center;font-size:11px;line-height:1.15em;"><span style="font-size:11px;">Location of <!-- |
| − | < | + | -->{{#if:<!--[0]-->{{{countryprefix|}}} |
| − | + | |<!--then:[0]-->{{{countryprefix}}} <!-- | |
| − | + | --end#if:[0]-->}}<span style="font-size:2px;"> </span>{{#ifexist:{{{country}}}|[[{{{country}}}]]|{{{country|[[{{PAGENAME}}]]}}}}}<!-- | |
| + | -->{{#ifeq:<!--[1]-->{{{location|{{{location_color|any}}}}}}|<!--equals:-->none | ||
| + | |<!--then:[1] either location or location_color passed as explicit demand not to indicate any (default location_color) value | ||
| + | -->|<!--else:[1]--><span style="font-size:8px;">{{spaces|2}}</span>({{{location|<span style="font-size:9px;">{{{location_color|orange}}}</span>}}})<!-- | ||
| + | --end#ifeq:[1]-->}}</span><!-- | ||
| + | -->{{#if:<!--[2]-->{{{region|{{{legend|}}}}}} | ||
| + | |<!--then:[2] | ||
| + | -->{{#if:<!--[3]-->{{{subregion|}}} | ||
| + | |<!--then:[3]--><p style="width:250px;font-size:11px;text-align:left;margin-left:1.2ex;margin-top:0px;margin-bottom:0px;line-height:1.15em;">– <!-- | ||
| + | -->|<!--else:[3]--><p style="width:250px;font-size:11px;text-align:center;margin-top:0px;margin-bottom:0px;line-height:1.15em;"><!-- | ||
| + | --end#if:[3]-->}}<!-- | ||
| + | -->{{#switch:<!--[4]-->{{{region|none}}} | ||
| + | | none = | ||
| + | | Europe | ||
| + | | [[Europe]] | ||
| + | | in Europe | ||
| + | | in [[Europe]] | ||
| + | | on the European continent | ||
| + | | on the [[Europe|European continent]] = on the [[Europe|European continent]] | ||
| + | | Pacific | ||
| + | | [[Pacific]] | ||
| + | | the Pacific | ||
| + | | the [[Pacific]] | ||
| + | | the Pacific Ocean = in the [[Pacific Ocean]] | ||
| + | | Antarctica | ||
| + | | [[Antarctica]] = on {{#ifexist:{{{region}}}|[[{{{region}}}]]|{{{region}}}}} | ||
| + | | Middle East | ||
| + | | [[Middle East]] | ||
| + | | Arctic Circle | ||
| + | | [[Arctic Circle]] | ||
| + | | Pacific Ocean | ||
| + | | [[Pacific Ocean]] = in the {{#ifexist:{{{region}}}|[[{{{region}}}]]|{{{region}}}}} | ||
| + | | #default = in {{#ifexist:{{{region}}}|[[{{{region}}}]]|{{{region}}}}} | ||
| + | <!--end#switch:[4]-->}}<!-- | ||
| + | -->{{#if:<!--[5]-->{{{region|}}} | ||
| + | |<!--then:[5] | ||
| + | -->{{#ifeq:<!--[6]-->{{{region_color|any}}}|<!--equals:-->none | ||
| + | |<!--then:[6] region_color passed as explicit demand not to indicate (default) color | ||
| + | -->|<!--else:[6]--><span style="font-size:8px;">{{spaces|2}}</span>(<span style="font-size:9px;"><!-- | ||
| + | -->{{#if:<!--[7]-->{{{subregion|}}} | ||
| + | |<!--then:[7] | ||
| + | -->{{#ifeq:<!--[8]-->{{{subregion_color|camel}}}|<!--equals:-->{{{region_color|white}}} | ||
| + | |<!--then:[8] mention colour once | ||
| + | -->|<!--else:[8] | ||
| + | -->{{#ifeq:<!--[8a]-->{{{subregion_color|any}}}|<!--equals:-->none | ||
| + | |<!--then:[8a] mention the one colour | ||
| + | -->|<!--else:[8a]-->{{{subregion_color|camel}}} & <!-- | ||
| + | --end#ifeq:[8a]-->}}<!-- | ||
| + | --end#ifeq:[8]-->}}{{{region_color|white}}}<!-- | ||
| + | -->|<!--else:[7]-->{{{region_color|white}}}<!-- | ||
| + | --end#if:[7]-->}}</span>)<!-- | ||
| + | --end#if:[6]-->}}<!-- | ||
| + | -->{{#if:<!--[9]-->{{{subregion|}}} | ||
| + | |<!--then:[9]--><br />– <!-- | ||
| + | -->{{#switch:<!--[10]-->{{{subregion|none}}} | ||
| + | | EU | ||
| + | | [[EU]] | ||
| + | | the EU | ||
| + | | the [[EU]] | ||
| + | | European Union | ||
| + | | [[European Union]] | ||
| + | | the European Union | ||
| + | | the [[European Union]] = in the [[European Union]] | ||
| + | | #default = in {{#ifexist:{{{subregion}}}|[[{{{subregion}}}]]|{{{subregion}}}}} | ||
| + | <!--end#switch[10]-->}}<!-- | ||
| + | -->{{#ifeq:<!--[11]-->{{{subregion_color|any}}}|<!--equals:-->none | ||
| + | |<!--then:[11] subregion_color passed as explicit demand not to indicate (default) color | ||
| + | -->|<!--else:[11]--><span style="font-size:8px;">{{spaces|2}}</span>(<span style="font-size:9px;">{{{subregion_color|camel}}}</span>)<!-- | ||
| + | --end#if:[11]-->}}<!-- | ||
| + | --end#if:[9]-->}}<!--else:[5] no region thus no SUBregion acceptable (hence no colours indicating region or subregion at region) | ||
| + | --end#if:[5]-->}}<!-- | ||
| + | -->{{#if:<!--[12]-->{{{legend|}}} | ||
| + | |<!--then[12]: | ||
| + | -->{{#switch:<!--[13]-->{{{subregion|none}}} | ||
| + | | EU | ||
| + | | [[EU]] | ||
| + | | the EU | ||
| + | | the [[EU]] | ||
| + | | European Union | ||
| + | | [[European Union]] | ||
| + | | the European Union | ||
| + | | the [[European Union]] = <!-- | ||
| + | -->{{#ifeq:<!--[13a]-->{{{subregion_color|camel}}}|<!--equals:-->camel | ||
| + | |<!--then:[13a]-->{{spaces|16}} <!-- | ||
| + | -->|<!--else:[13a]--> — <!-- | ||
| + | --end#ifeq:[13a]-->}} | ||
| + | | none = <!-- | ||
| + | -->{{#ifeq:<!--[14]-->{{{region|none}}}|<!--equals:-->none | ||
| + | |<!--then:[14] no spacer while legend has line all for itself | ||
| + | -->|<!--else:[14]--> — <!-- | ||
| + | --end#ifeq:[14]-->}} | ||
| + | | #default = — | ||
| + | <!--end#switch:[13]-->}} [<span style="font-size:10px;">[[:Image:{{{legend}}}|Legend]]</span>]<!-- | ||
| + | --end#if:[12]-->}}</p><!-- | ||
| + | --end#if:[2]-->}}</div><noinclude> | ||
| − | + | <div style="width:100%;text-align:center;font-size:9px;line-height:1.2em;"><div style="width:80%;background-color:#808080;color:#ffffff;text-align:center;">template output end<br/>note that it is ''supposed'' to be cut off at the bottom</div></div> | |
| − | + | <br/>{{template doc}} | |
| − | + | </noinclude> | |
| − | </ | ||
Revision as of 17:59, 18 July 2008
| 40x40px | This template employs intricate features of template syntax.
You are encouraged to familiarise yourself with its setup and parser functions before editing the template. If your edit causes unexpected problems, please undo it quickly, as this template may appear on a large number of pages. You can conduct experiments, and should test all major changes, in either this template's sandbox, the general template sandbox, or your user space before changing anything here. |
note that it is supposed to be cut off at the bottom
Template intended to simplify adding a standardized and formatted caption below a map indicating the location of something (e.g. a country), possibly referring to the map's main region and optionally also to a shown subregion. Original use within infoboxes (e.g. see articles on European countries). For a complete set of elements of reasonable length, a width of (minimally) 250px (without extra padding or margins) should be available.
Parameters
Required parameters shown in bold italics Script error: No such module "aligned table".
- Note
- If country, region or subregion is exactly the name of a page in article space, the template automatically creates a link to it. You can still put a link here manually, using the usual syntax.
Examples
| Code | Raw result (in unformatted box, compare to handling in Infobox) | |
{{map caption}}
| ||
| ||
{{map caption |region=Europe |legend=European location legend en.png}}
| ||
| ||
{{map caption |countryprefix=the |region=Europe |subregion=the [[European Union]] |legend=European location legend en.png}}
| ||
| ||
Typical sample for an article on a European Union member that needs no "the" before its name, for otherwise identical output:{{map caption |region=Europe |subregion=EU |legend=European location legend en.png}}
| ||
| ||
| Infobox usage of code (as intended) — in which the alignment, the padding/margins, and font are rendered differently (this template adjusts for that infobox): | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Sample for article named 'Armenia', about a non-European country
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| The above documentation is transcluded from Template:Map caption/doc. (edit | history) Editors can experiment in this template's sandbox (edit | diff) and testcases (edit) pages. Please add categories to the /doc subpage. Subpages of this template. |
