Difference between revisions of "Template:RealmBox/Sandbox"

From BattleMaster Wiki
Jump to navigation Jump to search
m
m
Line 1: Line 1:
{{RBTop}}{{RBTitle|TextColor = {{{TitleTextColor|Black}}}|BackColor = {{{TitleBackColor|#aabbcc}}}|Text = {{{Realm|{{PAGENAME}}}}}{{#if: {{{Flag|}}} | <br>[[Image:{{{Flag}}}]]{{#if: {{{FlagCaption|}}} | <br><div style="text-align: center; font-size: 75%; color: {{{TitleTextColor|Black}}}; font-weight:normal; font-style: oblique;">{{{FlagCaption}}}</div>|}}|}}{{#if: {{{MapName|}}} | <br>http://battlemaster.org/maps-{{:Template:RealmBox/{{{Island}}}}}/Realm-{{{MapName}}}.jpg |}}}}
+
<includeonly>{{#get_external_data:http://battlemaster.org/data/region.php?World={{{World|{{{1}}}}}}&ID={{{Region|{{{2}}}}}}|xml
 +
|Island=continent
 +
|TitleBackColor=colour
 +
|Realm=name
 +
|Government=system
 +
|RulerTitle=rulertitle
 +
|RulerName=rulername
 +
|GeneralTitle=generaltitle
 +
|GeneralName=generalname
 +
|JudgeTitle=judgetitle
 +
|JudgeName=judgename
 +
|BankerTitle=bankertitle
 +
|BankerName=bankername
 +
}}
 +
{{RBTop}}{{RBTitle|TextColor = {{{TitleTextColor|Black}}}|BackColor = {{{TitleBackColor|#aabbcc}}}|Text = {{#external_value:Realm}}{{#if: {{{Flag|}}} | <br>[[Image:{{{Flag}}}]]{{#if: {{{FlagCaption|}}} | <br><div style="text-align: center; font-size: 75%; color: {{{TitleTextColor|Black}}}; font-weight:normal; font-style: oblique;">{{{FlagCaption}}}</div>|}}|}}{{#if: {{{MapName|}}} | <br>http://battlemaster.org/maps-{{{World|{{{1}}}}}}/Realm-{{{MapName}}}.jpg |}}}}
 
{{RBDouble
 
{{RBDouble
 
|Left = <b>Island<br>Capital<br>Largest City<br>Government{{#if: {{{StateReligion|}}} | <br>State Religion|}}<br>Duchies<br>Regions{{#if: {{{Nobles|}}} | <br>Nobles|}}{{#if: {{{Food|}}} | <br>Food|}}{{#if: {{{Gold|}}} | <br>Gold|}}<br>Population</b>
 
|Left = <b>Island<br>Capital<br>Largest City<br>Government{{#if: {{{StateReligion|}}} | <br>State Religion|}}<br>Duchies<br>Regions{{#if: {{{Nobles|}}} | <br>Nobles|}}{{#if: {{{Food|}}} | <br>Food|}}{{#if: {{{Gold|}}} | <br>Gold|}}<br>Population</b>
|Right = [[Located on::{{{Island|{{c|red|"Island"}}}}}]]<br>{{#ask: [[capital of::{{{Realm|{{PAGENAME}}}}}]]| default=Unknown}}<br>{{#ask: [[part of::{{{Realm|{{PAGENAME}}}}}]] [[is regiontype::Stronghold||City]] | limit = 1 | sort = population | order = desc | searchlabel= | default=Unknown}}<br>[[government type is::{{{Government|{{c|red|"Government"}}}}}]]{{#if: {{{StateReligion|}}} | <br>[[has state religion::{{{StateReligion}}}]]|}}<br>{{#ask: [[part of::{{{Realm|{{PAGENAME}}}}}]] [[is regiontype::Stronghold||City]] | format = count | default=Unknown}}<br>{{#ask: [[part of::{{{Realm|{{PAGENAME}}}}}]] [[is regiontype::+]] | format = count | default=Unknown}}{{#if: {{{Nobles|}}} | <br>{{{Nobles|Unknown}}}|}}{{#if: {{{Food|}}} | <br>{{{Food|Unknown}}}|}}{{#if: {{{Gold|}}} | <br>{{{Gold|Unknown}}}|}}<br>{{#ask: [[part of::{{{Realm|{{PAGENAME}}}}}]] | ?population | format = sum | default = 0}}}}
+
|Right = [[Located on::{{#external_value:Island}}]]<br>{{#ask: [[capital of::{{#external_value:Realm}}]]| default=Unknown}}<br>{{#ask: [[part of::{{#external_value:Realm}}]] [[is regiontype::Stronghold||City]] | limit = 1 | sort = population | order = desc | searchlabel= | default=Unknown}}<br>[[government type is::{{#external_value:Government}}]]{{#if: {{{StateReligion|}}} | <br>[[has state religion::{{{StateReligion}}}]]|}}<br>{{#ask: [[part of::{{#external_value:Realm}}]] [[is regiontype::Stronghold||City]] | format = count | default=Unknown}}<br>{{#ask: [[part of::{{#external_value:Realm}}]] [[is regiontype::+]] | format = count | default=Unknown}}{{#if: {{{Nobles|}}} | <br>{{{Nobles|Unknown}}}|}}{{#if: {{{Food|}}} | <br>{{{Food|Unknown}}}|}}{{#if: {{{Gold|}}} | <br>{{{Gold|Unknown}}}|}}<br>{{#ask: [[part of::{{#external_value:Realm}}]] | ?population | format = sum | default = 0}}}}
 
{{RBTitle|TextColor = {{{TitleTextColor|black}}}|BackColor = {{{TitleBackColor|#aabbcc}}}|Text = Council}}
 
{{RBTitle|TextColor = {{{TitleTextColor|black}}}|BackColor = {{{TitleBackColor|#aabbcc}}}|Text = Council}}
{{RBDouble|BackColor = #CCCCCC|LeftTextWeight = bold|Left = {{{RulerTitle|Ruler}}}|Right = [[has ruler::{{{RulerName|{{c|red|"RulerName"}}}}}]]}}
+
{{RBDouble|BackColor = #CCCCCC|LeftTextWeight = bold|Left = {{{RulerTitle|Ruler}}}|Right = [[has ruler::{{#external_value:RulerName}}]]}}
{{RBDouble|LeftTextWeight = bold|Left = {{{GeneralTitle|General}}}<br>{{{BankerTitle|Banker}}}<br>{{{JudgeTitle|Judge}}}|Right = [[has general::{{{GeneralName|{{c|red|"GeneralName"}}}}}]]<br>[[has banker::{{{BankerName|{{c|red|"BankerName"}}}}}]]<br>[[has judge::{{{JudgeName|{{c|red|"JudgeName"}}}}}]]}}
+
{{RBDouble|LeftTextWeight = bold|Left = {{#external_value:GeneralTitle}}<br>{{#external_value:BankerTitle}}<br>{{#external_value:JudgeTitle}}|Right = [[has general::{{#external_value:GeneralName}}]]<br>[[has banker::{{#external_value:BankerName}}]]<br>[[has judge::{{#external_value:JudgeName}}]]}}
 
{{RBTitle |BackColor = {{{TitleBackColor|#aabbcc}}} |TextColor = {{{TitleTextColor|black}}} |Text = Regions }}
 
{{RBTitle |BackColor = {{{TitleBackColor|#aabbcc}}} |TextColor = {{{TitleTextColor|black}}} |Text = Regions }}
{{RBSingle|CellAlign=center|BackColor=#DDDDDD|Text = <table style="margin: 0px; border-collapse:collapse; width:300px; border: hidden;"><tr style="padding: 1px 0.5em; text-align: left; font-size: 100%; color: black; font-weight:normal; border-bottom: 1px solid #FFFFFF; background: #DDDDDD; width: 50%;"><td>'''Region'''</td><td>'''Lord'''</td></tr>{{#ask: [[part of::{{{Realm|{{PAGENAME}}}}}]] | mainlabel=region | ?has lord=Lord | format = template | template = SemanticTest | headers = hide | default=Unknown}}</table>}}
+
{{RBSingle|CellAlign=center|BackColor=#DDDDDD|Text = <table style="margin: 0px; border-collapse:collapse; width:300px; border: hidden;"><tr style="padding: 1px 0.5em; text-align: left; font-size: 100%; color: black; font-weight:normal; border-bottom: 1px solid #FFFFFF; background: #DDDDDD; width: 50%;"><td>'''Region'''</td><td>'''Lord'''</td></tr>{{#ask: [[part of::{{#external_value:Realm}}]] | mainlabel=region | ?has lord=Lord | format = template | template = SemanticTest | headers = hide | default=Unknown}}</table>}}
{{RBBottom}}
+
{{RBBottom}}</includeonly>
 
<noinclude>{{DocSubpage}}
 
<noinclude>{{DocSubpage}}
Current modifications:
+
Complete revamp to use external data API.
* Removed the "World" parameter. Added subpages to the [[Template:RealmBox]] to auto-grab the world number from the required "Island" parameter.
 
* Repurposed "Realm" parameter to hold the realm name with spaces replaced by "%20" in order to grab the realm map. The realm name displayed on the page is once again determined from the <nowiki>{{PAGENAME}}</nowiki> variable. If you want a realm map, specify a "Realm" parameter. Leave this out and you don't get a realm map.
 
 
</noinclude>
 
</noinclude>

Revision as of 22:59, 25 March 2009

Gtk-dialog-info.svg Page Information
This is a documentation subpage for the RealmBox template.
It contains usage information, categories and other content that is not part of the original template page.

Complete revamp to use external data API.