Template:Infobox Growing Region: Difference between revisions
Template page
More actions
Eloise Zomia (talk | contribs) No edit summary |
Eloise Zomia (talk | contribs) No edit summary Tag: Reverted |
||
| Line 1: | Line 1: | ||
<includeonly> | <includeonly> | ||
<templatestyles src="Template:Infobox Growing Region/styles.css" /> | <templatestyles src="Template:Infobox Growing Region/styles.css" /> | ||
<!-- ========================================================= --> | |||
<!-- Normalization helpers (strip [[ ]], extract Page|Label) --> | |||
<!-- ========================================================= --> | |||
{{#vardefine:REGION|{{{region_name|{{PAGENAME}}}}}}} | |||
{{#vardefine:GP_RAW|{{#replace:{{#replace:{{#trim:{{{gene_pool|}}}}}|[[|}}|]]|}}}} | |||
{{#vardefine:GP_PAGE|{{#trim:{{#explode:{{#var:GP_RAW}}}|{{!}}|0}}}}} | |||
{{#vardefine:GP_LABEL|{{#trim:{{#explode:{{#var:GP_RAW}}}|{{!}}|1}}}}} | |||
{{#vardefine:RC_RAW|{{#replace:{{#replace:{{#trim:{{{regional_complex|}}}}}|[[|}}|]]|}}}} | |||
{{#vardefine:RC_PAGE|{{#trim:{{#explode:{{#var:RC_RAW}}}|{{!}}|0}}}}} | |||
{{#vardefine:RC_LABEL|{{#trim:{{#explode:{{#var:RC_RAW}}}|{{!}}|1}}}}} | |||
<!-- Countries display (linked list) --> | |||
{{#vardefine:COUNTRY_DISPLAY| | |||
{{#arraymap:{{{country|}}}|,|x| | |||
{{#vardefine:RAW|{{#replace:{{#replace:{{#trim:x}}|[[|}}|]]|}}}} | |||
{{#vardefine:PAGE|{{#trim:{{#explode:{{#var:RAW}}}|{{!}}|0}}}}} | |||
{{#vardefine:LABEL|{{#trim:{{#explode:{{#var:RAW}}}|{{!}}|1}}}}} | |||
{{#if:{{#var:PAGE}}| | |||
[[{{#var:PAGE}}|{{#if:{{#var:LABEL}}|{{#var:LABEL}}|{{#var:PAGE}}}}]] | |||
}} | |||
|, }} | |||
}} | |||
<!-- Provinces display (linked list) --> | |||
{{#vardefine:PROVINCE_DISPLAY| | |||
{{#arraymap:{{{provinces|}}}|,|x| | |||
{{#vardefine:RAW|{{#replace:{{#replace:{{#trim:x}}|[[|}}|]]|}}}} | |||
{{#vardefine:PAGE|{{#trim:{{#explode:{{#var:RAW}}}|{{!}}|0}}}}} | |||
{{#vardefine:LABEL|{{#trim:{{#explode:{{#var:RAW}}}|{{!}}|1}}}}} | |||
{{#if:{{#var:PAGE}}| | |||
[[{{#var:PAGE}}|{{#if:{{#var:LABEL}}|{{#var:LABEL}}|{{#var:PAGE}}}}]] | |||
}} | |||
|, }} | |||
}} | |||
<!-- Rivers display (linked list) --> | |||
{{#vardefine:RIVER_DISPLAY| | |||
{{#arraymap:{{{primary_river|}}}|,|x| | |||
{{#vardefine:RAW|{{#replace:{{#replace:{{#trim:x}}|[[|}}|]]|}}}} | |||
{{#vardefine:PAGE|{{#trim:{{#explode:{{#var:RAW}}}|{{!}}|0}}}}} | |||
{{#vardefine:LABEL|{{#trim:{{#explode:{{#var:RAW}}}|{{!}}|1}}}}} | |||
{{#if:{{#var:PAGE}}| | |||
[[{{#var:PAGE}}|{{#if:{{#var:LABEL}}|{{#var:LABEL}}|{{#var:PAGE}}}}]] | |||
}} | |||
|, }} | |||
}} | |||
<!-- Mountains display (linked list) --> | |||
{{#vardefine:MOUNTAIN_DISPLAY| | |||
{{#arraymap:{{{primary_mountains|}}}|,|x| | |||
{{#vardefine:RAW|{{#replace:{{#replace:{{#trim:x}}|[[|}}|]]|}}}} | |||
{{#vardefine:PAGE|{{#trim:{{#explode:{{#var:RAW}}}|{{!}}|0}}}}} | |||
{{#vardefine:LABEL|{{#trim:{{#explode:{{#var:RAW}}}|{{!}}|1}}}}} | |||
{{#if:{{#var:PAGE}}| | |||
[[{{#var:PAGE}}|{{#if:{{#var:LABEL}}|{{#var:LABEL}}|{{#var:PAGE}}}}]] | |||
}} | |||
|, }} | |||
}} | |||
<!-- ========================================================= --> | |||
<!-- Infobox --> | |||
<!-- ========================================================= --> | |||
{| class="infobox lw-infobox lw-infobox--growing-region" | {| class="infobox lw-infobox lw-infobox--growing-region" | ||
|- | |- | ||
! colspan="2" class="lw-infobox__title" | {{ | ! colspan="2" class="lw-infobox__title" | {{#var:REGION}} | ||
|- | |- | ||
{{#if:{{{other_name|}}}| | {{#if:{{{other_name|}}}| | ||
| Line 9: | Line 76: | ||
{{!}}- | {{!}}- | ||
}} | }} | ||
{{#if:{{{image|}}}| | {{#if:{{{image|}}}| | ||
{{!}} colspan="2" class="lw-infobox__media" {{!}} [[File:{{{image}}}|320px|{{{image_caption|View of {{ | {{!}} colspan="2" class="lw-infobox__media" {{!}} [[File:{{{image}}}|320px|{{{image_caption|View of {{#var:REGION}}}}}]] | ||
{{!}}- | {{!}}- | ||
{{#if:{{{image_caption|}}}| | {{#if:{{{image_caption|}}}| | ||
| Line 17: | Line 85: | ||
}} | }} | ||
}} | }} | ||
{{#if:{{{show_map|}}}| | {{#if:{{{show_map|}}}| | ||
{{!}} colspan="2" class="lw-infobox__map-container" {{!}} <div class="lw-infobox__map lw-map" data-smw-query="[[Has growing region::{{PAGENAME}}]]{{!}}?Has GPS coordinates{{!}}?Has descriptive name{{!}}?Has conservation priority{{!}}?Has accession ID"></div><div class="lw-infobox__map-expand" title="Expand map">⛶</div> | {{!}} colspan="2" class="lw-infobox__map-container" {{!}} | ||
<div class="lw-infobox__map lw-map" data-smw-query="[[Has growing region::{{PAGENAME}}]]{{!}}?Has GPS coordinates{{!}}?Has descriptive name{{!}}?Has conservation priority{{!}}?Has accession ID"></div> | |||
<div class="lw-infobox__map-expand" title="Expand map">⛶</div> | |||
{{!}}- | {{!}}- | ||
}} | }} | ||
|- | |- | ||
! class="lw-infobox__label" | Location | ! class="lw-infobox__label" | Location | ||
| class="lw-infobox__value" | {{{location|{{{country|}}}}}} | | class="lw-infobox__value" | | ||
{{#if:{{{location|}}}| | |||
{{{location}}} | |||
| {{#if:{{{country|}}}|{{#var:COUNTRY_DISPLAY}}}} | |||
}} | |||
|- | |- | ||
{{#if:{{{coordinates|}}}| | {{#if:{{{coordinates|}}}| | ||
| Line 30: | Line 107: | ||
{{!}}- | {{!}}- | ||
}} | }} | ||
{{#if:{{{gene_pool|}}}| | {{#if:{{{gene_pool|}}}| | ||
! class="lw-infobox__label" {{!}} Gene Pool | ! class="lw-infobox__label" {{!}} Gene Pool | ||
{{!}} class="lw-infobox__value" {{!}} {{{gene_pool}}} | {{!}} class="lw-infobox__value" {{!}} | ||
{{#if:{{#var:GP_PAGE}}| | |||
[[{{#var:GP_PAGE}}|{{#if:{{#var:GP_LABEL}}|{{#var:GP_LABEL}}|{{#var:GP_PAGE}}}}]] | |||
| {{{gene_pool}}} | |||
}} | |||
{{!}}- | {{!}}- | ||
}} | }} | ||
{{#if:{{{regional_complex|}}}| | {{#if:{{{regional_complex|}}}| | ||
! class="lw-infobox__label" {{!}} Regional Complex | ! class="lw-infobox__label" {{!}} Regional Complex | ||
{{!}} class="lw-infobox__value" {{!}} {{{regional_complex}}} | {{!}} class="lw-infobox__value" {{!}} | ||
{{#if:{{#var:RC_PAGE}}| | |||
[[{{#var:RC_PAGE}}|{{#if:{{#var:RC_LABEL}}|{{#var:RC_LABEL}}|{{#var:RC_PAGE}}}}]] | |||
| {{{regional_complex}}} | |||
}} | |||
{{!}}- | {{!}}- | ||
}} | }} | ||
{{#if:{{{country|}}}| | {{#if:{{{country|}}}| | ||
! class="lw-infobox__label" {{!}} Country | ! class="lw-infobox__label" {{!}} Country | ||
{{!}} class="lw-infobox__value" {{!}} {{ | {{!}} class="lw-infobox__value" {{!}} {{#var:COUNTRY_DISPLAY}} | ||
{{!}}- | {{!}}- | ||
}} | }} | ||
{{#if:{{{provinces|}}}| | {{#if:{{{provinces|}}}| | ||
! class="lw-infobox__label" {{!}} Provinces/States | ! class="lw-infobox__label" {{!}} Provinces/States | ||
{{!}} class="lw-infobox__value" {{!}} {{ | {{!}} class="lw-infobox__value" {{!}} {{#var:PROVINCE_DISPLAY}} | ||
{{!}}- | {{!}}- | ||
}} | }} | ||
{{#if:{{{elevation_range|}}}| | {{#if:{{{elevation_range|}}}| | ||
! class="lw-infobox__label" {{!}} Elevation Range | ! class="lw-infobox__label" {{!}} Elevation Range | ||
| Line 55: | Line 145: | ||
{{!}}- | {{!}}- | ||
}} | }} | ||
{{#if:{{{area_extent|}}}| | {{#if:{{{area_extent|}}}| | ||
! class="lw-infobox__label" {{!}} Area | ! class="lw-infobox__label" {{!}} Area | ||
| Line 60: | Line 151: | ||
{{!}}- | {{!}}- | ||
}} | }} | ||
{{#if:{{{climate|}}}| | {{#if:{{{climate|}}}| | ||
! class="lw-infobox__label" {{!}} Climate | ! class="lw-infobox__label" {{!}} Climate | ||
| Line 65: | Line 157: | ||
{{!}}- | {{!}}- | ||
}} | }} | ||
{{#if:{{{primary_river|}}}| | {{#if:{{{primary_river|}}}| | ||
! class="lw-infobox__label" {{!}} Primary Rivers | ! class="lw-infobox__label" {{!}} Primary Rivers | ||
{{!}} class="lw-infobox__value" {{!}} {{ | {{!}} class="lw-infobox__value" {{!}} {{#var:RIVER_DISPLAY}} | ||
{{!}}- | {{!}}- | ||
}} | }} | ||
{{#if:{{{primary_mountains|}}}| | {{#if:{{{primary_mountains|}}}| | ||
! class="lw-infobox__label" {{!}} Primary Mountains | ! class="lw-infobox__label" {{!}} Primary Mountains | ||
{{!}} class="lw-infobox__value" {{!}} {{ | {{!}} class="lw-infobox__value" {{!}} {{#var:MOUNTAIN_DISPLAY}} | ||
{{!}}- | {{!}}- | ||
}} | }} | ||
{{#if:{{{status|}}}| | {{#if:{{{status|}}}| | ||
! class="lw-infobox__label" {{!}} Conservation Status | ! class="lw-infobox__label" {{!}} Conservation Status | ||
| Line 81: | Line 176: | ||
}} | }} | ||
|} | |} | ||
<!-- Semantic properties | |||
<!-- ========================================================= --> | |||
<!-- Semantic properties --> | |||
<!-- ========================================================= --> | |||
[[Category:Growing Regions]] | [[Category:Growing Regions]] | ||
{{#set: | {{#set: | ||
|Has region name={{ | |Has region name={{#var:REGION}} | ||
|Has alternate name={{{other_name|}}} | |Has alternate name={{{other_name|}}} | ||
|Has image={{{image|}}} | |Has image={{{image|}}} | ||
|Has image caption={{{image_caption|}}} | |Has image caption={{{image_caption|}}} | ||
|Has gene pool={{#var:GP_PAGE}} | |||
|Has gene pool={{ | |Has regional complex={{#var:RC_PAGE}} | ||
|Has regional complex={{ | |||
|Has elevation range={{{elevation_range|}}} | |Has elevation range={{{elevation_range|}}} | ||
|Has area extent={{{area_extent|}}} | |Has area extent={{{area_extent|}}} | ||
| Line 97: | Line 196: | ||
|Has description={{{description|}}} | |Has description={{{description|}}} | ||
}} | }} | ||
<!-- | |||
{{#arraymap:{{{country|}}}|,|x|{{#set:|Has country= | <!-- Coordinates: store ONLY if it's already decimal (not {{coord...}}) --> | ||
{{#arraymap:{{{provinces|}}}|,|x|{{#set:|Has province= | {{#if:{{{coordinates|}}}| | ||
{{#arraymap:{{{primary_river|}}}|,|x|{{#set:|Has primary river= | {{#ifexpr:{{#pos:{{lc:{{{coordinates}}}}}|{{lc:{{coord}}}}}}} = -1 | | ||
{{#arraymap:{{{primary_mountains|}}}|,|x|{{#set:|Has primary mountains= | {{#set: |Has coordinates={{{coordinates}}} }} | ||
}} | |||
}} | |||
<!-- Multi-value page props: store clean page titles --> | |||
{{#arraymap:{{{country|}}}|,|x| | |||
{{#vardefine:RAW|{{#replace:{{#replace:{{#trim:x}}|[[|}}|]]|}}}} | |||
{{#vardefine:PAGE|{{#trim:{{#explode:{{#var:RAW}}}|{{!}}|0}}}}} | |||
{{#if:{{#var:PAGE}}|{{#set:|Has country={{#var:PAGE}}}}} | |||
|}} | |||
{{#arraymap:{{{provinces|}}}|,|x| | |||
{{#vardefine:RAW|{{#replace:{{#replace:{{#trim:x}}|[[|}}|]]|}}}} | |||
{{#vardefine:PAGE|{{#trim:{{#explode:{{#var:RAW}}}|{{!}}|0}}}}} | |||
{{#if:{{#var:PAGE}}|{{#set:|Has province={{#var:PAGE}}}}} | |||
|}} | |||
{{#arraymap:{{{primary_river|}}}|,|x| | |||
{{#vardefine:RAW|{{#replace:{{#replace:{{#trim:x}}|[[|}}|]]|}}}} | |||
{{#vardefine:PAGE|{{#trim:{{#explode:{{#var:RAW}}}|{{!}}|0}}}}} | |||
{{#if:{{#var:PAGE}}|{{#set:|Has primary river={{#var:PAGE}}}}} | |||
|}} | |||
{{#arraymap:{{{primary_mountains|}}}|,|x| | |||
{{#vardefine:RAW|{{#replace:{{#replace:{{#trim:x}}|[[|}}|]]|}}}} | |||
{{#vardefine:PAGE|{{#trim:{{#explode:{{#var:RAW}}}|{{!}}|0}}}}} | |||
{{#if:{{#var:PAGE}}|{{#set:|Has primary mountains={{#var:PAGE}}}}} | |||
|}} | |||
</includeonly> | </includeonly> | ||
<noinclude> | <noinclude> | ||
Documentation goes here. | Documentation goes here. | ||
</noinclude> | </noinclude> | ||
Revision as of 23:19, 19 January 2026
Documentation goes here.