Difference between revisions of "Template:Infobox RegionData"

From BattleMaster Wiki
Jump to navigation Jump to search
(updated API link)
 
(19 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{#get_external_data:http://battlemaster.org/data/region.php?World={{{1}}}&ID={{{2}}}|xml
+
{{#get_web_data:url=https://battlemaster.org/data/region/{{{1}}}/{{{2}}}|format=XML
|continent=continent
+
|data=continent=continent,regtype=type,area=area,population=population,economy=economy,realm=realm,duchy=duchy,lord=lord,capital=capital
|name=name
 
|regtype=type
 
|area=area
 
|population=population
 
|economy=economy
 
|realm=realm
 
|duchy=duchy
 
|lord=lord
 
 
}}
 
}}
 
{| class="infobox" border="1px" style="float: right; border-spacing: 2px; font-size: 95%; text-align: left; border-collapse: collapse; margin-left: 1em; background: #eee;"
 
{| class="infobox" border="1px" style="float: right; border-spacing: 2px; font-size: 95%; text-align: left; border-collapse: collapse; margin-left: 1em; background: #eee;"
 
|-
 
|-
| colspan="2" style="background: #000; text-align:center; color: #fff; font-size: 150%;" | {{#external_value:name}}
+
| colspan="2" style="background: #000; text-align:center;" | https://battlemaster.org/dynamicmap_mini.php?SetWorld={{{1}}}&ShowRegion={{{2}}}
|-
 
| colspan="2" style="background: #000; text-align:center;" | http://battlemaster.org/maps-{{{1}}}/{{{2}}}.jpg
 
 
|-
 
|-
 
| colspan="2" style="background: #cce; text-align:center; font-weight:bold;" | Region Details
 
| colspan="2" style="background: #cce; text-align:center; font-weight:bold;" | Region Details
Line 40: Line 30:
 
{{!}}-  
 
{{!}}-  
 
{{!}} style="background: #ddf; font-weight:bold;" {{!}} Local Lord
 
{{!}} style="background: #ddf; font-weight:bold;" {{!}} Local Lord
{{!}} [[has lord::{{#external_value:lord}}]]
+
{{!}} [[has lord::{{#external_value:lord}}| ]] {{FamilyLink|{{{World|{{{1}}}}}}|{{#external_value:lord}}}}
 
|}}
 
|}}
 
|}
 
|}
<includeonly>[[Category:{{#external_value:continent}} Regions]]</includeonly>
+
{{#ifeq: {{#external_value:capital}} | true | {{#set: capital of={{#external_value:realm}}}} |}}
 +
<includeonly>
 +
[[Category:{{#external_value:continent}} Regions]]
 +
[[Category:{{#external_value:realm}}]]
 +
</includeonly>
 
<noinclude>
 
<noinclude>
 
This is the "official" region infobox. It is intended to be used on the official region page for a region. It should not be used on any other page, including realm subpages and user pages.
 
This is the "official" region infobox. It is intended to be used on the official region page for a region. It should not be used on any other page, including realm subpages and user pages.
Line 54: Line 48:
 
{{Infobox RegionData|(world-id)|(region-id)}}
 
{{Infobox RegionData|(world-id)|(region-id)}}
 
</pre></div>
 
</pre></div>
 
  
 
{{SemanticCodes}}
 
{{SemanticCodes}}
  
 
== Notes ==
 
== Notes ==
* The template also puts the region into the [[:Category:Regions]] and the appropriate island category.
+
* The template also puts the region into the appropriate categories (especially under [[:Category:Regions]]), so please do not add your own categories to pages that include this category. Especially not categories pertaining to any data that is used in this template, such as realm.
* This template is currently experimental, please do not yet use it on actual region pages
 
 
</noinclude>
 
</noinclude>

Latest revision as of 22:58, 26 January 2022

Error: No contents found at URL https://battlemaster.org/data/region/{{{1}}}/{{{2}}}.

https://battlemaster.org/dynamicmap_mini.php?SetWorld={{{1}}}&ShowRegion={{{2}}}
Region Details
Continent
Region Type
Geographic Area
Population
Economy
Politics
Realm


This is the "official" region infobox. It is intended to be used on the official region page for a region. It should not be used on any other page, including realm subpages and user pages.

This infobox uses semantic codes and fetches its data from the game itself, so it is guaranteed to always show correct values.

The infobox should be added as shown below:

{{Infobox RegionData|(world-id)|(region-id)}}
Template-info.svg Semantic Coded Template
This template contains semantic coding. Do not use this template for anything other than its intended purpose.

Notes

  • The template also puts the region into the appropriate categories (especially under Category:Regions), so please do not add your own categories to pages that include this category. Especially not categories pertaining to any data that is used in this template, such as realm.