Difference between revisions of "Template:Place"

From Shangpa Resource Center
 
(51 intermediate revisions by the same user not shown)
Line 7: Line 7:
 
|Name=
 
|Name=
 
|Place Type=
 
|Place Type=
|Coordinates
 
 
|Name Variants=
 
|Name Variants=
 +
|Coordinates=
 
|Events=
 
|Events=
 
|Notes=
 
|Notes=
Line 15: Line 15:
 
</pre>
 
</pre>
 
Edit the page to see the template text.
 
Edit the page to see the template text.
</noinclude><includeonly>
+
</noinclude><includeonly>__NOTOC__
 
{{#set:PlaceID={{{Place ID|}}}}}
 
{{#set:PlaceID={{{Place ID|}}}}}
 
{{#set:PlaceType={{{Place Type|}}}}}
 
{{#set:PlaceType={{{Place Type|}}}}}
 
{{#arraymap:{{{Name Variants|}}}|,|x|{{#set:NameVariants=x}}}}
 
{{#arraymap:{{{Name Variants|}}}|,|x|{{#set:NameVariants=x}}}}
 +
{{#set:Coordinates={{{Coordinates|}}}}}
 
{{#arraymap:{{{Events|}}}|,|x|{{#set:Events=x}}}}
 
{{#arraymap:{{{Events|}}}|,|x|{{#set:Events=x}}}}
 
{{#arraymap:{{{Links|}}}|,|x|{{#set:Links=x}}}}
 
{{#arraymap:{{{Links|}}}|,|x|{{#set:Links=x}}}}
Line 30: Line 31:
 
| {{{Place Type|}}}
 
| {{{Place Type|}}}
 
|-
 
|-
!{{#ifexist: File:{{{Place ID|}}}.jpg | [[File:{{{Place ID|}}}.jpg|100px]] | [[File:PlaceDefaultImage.jpg|100px]]  }}
+
{{#if: {{{Coordinates|}}} |
|-
+
! Coordinates
 +
{{!}} {{{Coordinates|}}}
 +
{{!}}-|}}
 
! Links
 
! Links
| {{#arraymap:{{{Links|}}}|,|x|x}}
+
| {{#arraymap:{{{Links|}}}|,|x|x|<br/>}}
 
|}
 
|}
 
</div>
 
</div>
Line 42: Line 45:
  
 
   .firstHeading {
 
   .firstHeading {
     margin-left: 31%;
+
     margin-left: 21%;
 
  }
 
  }
 
}}
 
}}
 
<div class="text_right_column">
 
<div class="text_right_column">
 
<h2 class="h2_person">Name Variants</h2>
 
<h2 class="h2_person">Name Variants</h2>
{{#arraymap:{{{Name Variants|}}}|,|x|x}}
+
{{#arraymap:{{{Name Variants|}}}|,|x|x|<br/>}}
<h2 class="h2_person">Associated Persons</h2>
+
{{#arraydefine: ArrayPlacesFoundedMonastery
 +
|{{#ask: [[Category:Person]] [[Monastery founded::{{BASEPAGENAME}}]] |headers=hide}}
 +
|, | sort=asc, unique
 +
}}{{#arraydefine: ArrayPlacesPrimarySeat
 +
|{{#ask: [[Category:Person]] [[PlacesPrimarySeat::{{BASEPAGENAME}}]] |headers=hide }}
 +
|, | sort=asc, unique
 +
}}{{#arraydefine: ArrayPlacesBirth
 +
|{{#ask: [[Category:Person]] [[PlacesBirth::{{BASEPAGENAME}}]] |headers=hide }}
 +
|, | sort=asc, unique
 +
}}{{#arraydefine: ArrayPlacesDeath
 +
|{{#ask: [[Category:Person]] [[PlacesDeath::{{BASEPAGENAME}}]] |headers=hide}}
 +
|, | sort=asc, unique
 +
}}
 +
{{#ifexpr: {{#arraysize:ArrayPlacesFoundedMonastery}}+{{#arraysize:ArrayPlacesPrimarySeat}}+{{#arraysize:ArrayPlacesBirth}}+{{#arraysize:ArrayPlacesDeath}} = 0 ||<h2 class="h2_person">Associated Persons</h2>
 +
{{#ifeq: {{#arraysize:ArrayPlacesFoundedMonastery}} | 0 || <h3 class="h3_person">Monastry Founded by</h3><ul>{{#arrayprint: ArrayPlacesFoundedMonastery||@@@@|<li>@@@@</li> }}</ul> }}
 +
{{#ifeq: {{#arraysize:ArrayPlacesPrimarySeat}} | 0 || <h3 class="h3_person">Primary seat</h3><ul>{{#arrayprint: ArrayPlacesPrimarySeat||@@@@|<li>@@@@</li> }}</ul> }}
 +
{{#ifeq: {{#arraysize:ArrayPlacesBirth}} | 0 || <h3 class="h3_person">Born at that place</h3><ul>{{#arrayprint: ArrayPlacesBirth||@@@@|<li>@@@@</li> }}</ul> }}
 +
{{#ifeq: {{#arraysize:ArrayPlacesDeath}} | 0 || <h3 class="h3_person">Died at that place</h3><ul>{{#arrayprint: ArrayPlacesDeath||@@@@|<li>@@@@</li> }}</ul> }}
 +
}}
 +
<h2 class="h2_person">History</h2>
 
<ul>
 
<ul>
<li>Born at that place: {{#ask: [[Category:Person]] [[PlacesBirth::{{BASEPAGENAME}}]] |headers=hide }}</li>
+
{{#arraymap:{{{Events|}}}|,|x|<li>x</li>|}}
<li>Died at that place: {{#ask: [[Category:Person]] [[PlacesDeath::{{BASEPAGENAME}}]] |headers=hide }}</li>
 
 
</ul>
 
</ul>
<h2 class="h2_person">History</h2>
+
{{#if: {{{Notes|}}} | <h2 class="h2_person">Notes</h2>{{{Notes|}}}<br/> |}}
{{#arraymap:{{{Events|}}}|,|x|x}}
+
{{#if: {{{Coordinates|}}} | <br/>{{#display_map:{{{Coordinates|}}}|service=leaflet|zoom=10}} |}}
 
</div>
 
</div>
 
[[Category:Place]]
 
[[Category:Place]]
 
</includeonly>
 
</includeonly>

Latest revision as of 18:33, 9 June 2019

This is the "Place" template. It should be called in the following format:

{{Place
|Place ID=
|Name=
|Place Type=
|Name Variants=
|Coordinates=
|Events=
|Notes=
|Links=
}}

Edit the page to see the template text.