Difference between revisions of "Template:RealmBox/Sandbox"

From BattleMaster Wiki
Jump to navigation Jump to search
m (some proposed changes)
m (Fixed minor bracket mistake; made FlagSize default to a non-rendered caption)
 
(29 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 +
<includeonly>{{#get_web_data:url=http://battlemaster.org/data/realm.php?World={{{World|{{{1}}}}}}&ID={{{RealmID|{{{2}}}}}}|format=XML
 +
|data=
 +
Island=continent,
 +
TitleBackColor=colour,
 +
Realm=name,
 +
Capital=capital,
 +
FullName=fullname,
 +
Government=system,
 +
Duchies=duchycount,
 +
RulerTitle=rulertitle,
 +
RulerName=rulername,
 +
GeneralTitle=generaltitle,
 +
GeneralName=generalname,
 +
JudgeTitle=judgetitle,
 +
JudgeName=judgename,
 +
BankerTitle=bankertitle,
 +
BankerName=bankername
 +
Regions=regioncount,
 +
Population=population,
 +
Gold=gold,
 +
Food=food,
 +
Nobles=nobles,
 +
}}
 
{{RBTop}}
 
{{RBTop}}
{{RBTitle|TextColor = {{{TitleTextColor|Black}}}|BackColor = {{{TitleBackColor|#aabbcc}}}|Text = {{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: {{{Realm|}}} | <br>http://battlemaster.org/maps-{{:Template:RealmBox/{{{Island}}}}}/Realm-{{{Realm}}}.jpg |}}}}
+
{{RBTitle
 +
|TextColor = {{{TitleTextColor|{{{3|Black}}}}}}
 +
|BackColor = {{{TitleColor|{{{4|{{#external_value:TitleBackColor}}}}}}}}
 +
|Text = {{#external_value:FullName}} {{#if: {{{Flag|}}} | <br>[[File:{{{Flag}}}|{{{FlagSize|blank caption}}}]] {{#if: {{{FlagCaption|}}} | <br><div style="text-align: center; font-size: 75%; color: {{{TitleTextColor|Black}}}; font-weight:normal; font-style: oblique;">{{{FlagCaption}}}</div>|}}|}}<br><img src="http://battlemaster.org/experimental/RealmMap.php?shownames=regions&onlyRealm=yes&World={{{World|{{{1}}}}}}&Realm={{{RealmID|{{{2}}}}}}" height="{{{MapHeight|237}}}" width="{{{MapWidth|313}}}"> |}}
 +
{{RBTitle
 +
|TextColor = {{{TitleTextColor|{{{3|Black}}}}}}
 +
|BackColor = {{{TitleColor|{{{4|{{#external_value:TitleBackColor}}}}}}}}
 +
|Text = Overview}}
 
{{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 =
|Right = [[Located on::{{{Island|{{c|red|"Island"}}}}}]]<br>{{#ask: [[capital of::{{PAGENAME}}]]| default=Unknown}}<br>{{#ask: [[part of::{{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::{{PAGENAME}}]] [[is regiontype::Stronghold||City]] | format = count | default=Unknown}}<br>{{#ask: [[part of::{{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::{{PAGENAME}}]] | ?population | format = sum | default = 0}}}}
+
<b>Island
{{RBTitle|TextColor = {{{TitleTextColor|black}}}|BackColor = {{{TitleBackColor|#aabbcc}}}|Text = Council}}
+
Capital
{{RBDouble|BackColor = #CCCCCC|LeftTextWeight = bold|Left = {{{RulerTitle|Ruler}}}|Right = [[has ruler::{{{RulerName|{{c|red|"RulerName"}}}}}]]}}
+
<br>Government
{{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"}}}}}]]}}
+
{{#if: {{{StateReligion|}}} | <br>State Religion<br>|}}
{{RBTitle |BackColor = {{{TitleBackColor|#aabbcc}}} |TextColor = {{{TitleTextColor|black}}} |Text = Regions }}
+
Duchies
{{RBSingle|CellAlign=center|Text = {{#ask: [[part of::{{PAGENAME}}]] | mainlabel=region | ?has lord=Lord | format = broadtable | headers = hide | default=Unknown}} }}
+
<br>Regions
 +
<br>Population
 +
<br>Gold
 +
<br>Food
 +
<br>Nobles</b>
 +
|Right =
 +
[[Located on::{{#external_value:Island}}]]
 +
[[{{#external_value:Capital}}]]
 +
<br>[[government type is::{{#external_value:Government}}]]
 +
{{#if: {{{StateReligion|}}} | <br>[[has state religion::{{{StateReligion}}}]]<br>|}}
 +
{{#external_value:Duchies}}
 +
<br>{{#external_value:RegionCount}}
 +
<br>{{#external_value:Population}}
 +
<br>{{#external_value:Gold}}
 +
<br>{{#external_value:Food}}
 +
<br>{{#external_value:Nobles}}}}
 +
{{RBTitle
 +
|TextColor = {{{TitleTextColor|{{{3|Black}}}}}}
 +
|BackColor = {{{TitleColor|{{{4|{{#external_value:TitleBackColor}}}}}}}}
 +
|Text = Council}}
 +
{{RBDouble
 +
|BackColor = #CCCCCC
 +
|LeftTextWeight = bold
 +
|Left = {{#external_value:RulerTitle}}
 +
|Right = [[has ruler::{{#external_value:RulerName}}| ]] {{FamilyLink|{{{World|{{{1}}}}}}|{{#external_value:RulerName}}}} }}
 +
{{RBDouble
 +
|LeftTextWeight = bold
 +
|Left =
 +
{{#external_value:GeneralTitle}}
 +
{{#external_value:JudgeTitle}}
 +
<br>{{#external_value:BankerTitle}}
 +
|Right = {{FamilyLink|{{{World|{{{1}}}}}}|{{#external_value:GeneralName}}}} {{#set: has general::{{#external_value:GeneralName}}}}
 +
{{FamilyLink|{{{World|{{{1}}}}}}|{{#external_value:JudgeName}}}} {{#set: has judge::{{#external_value:JudgeName}}}}
 +
<br>{{FamilyLink|{{{World|{{{1}}}}}}|{{#external_value:BankerName}}}} {{#set: has banker::{{#external_value:BankerName}}}}
 +
}}
 +
{{RBTitle  
 +
|BackColor = {{{TitleColor|{{{4|{{#external_value:TitleBackColor}}}}}}}}
 +
|TextColor = {{{TitleTextColor|{{{3|Black}}}}}}  
 +
|Text = Regions }}
 +
{{RBSingle
 +
|CellAlign=center
 +
|BackColor=#DDDDDD
 +
|Text = <table style="margin: 0px; border-collapse:collapse; width:95%; 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 = RegionListFormat | headers = hide | default=Unknown}}</table>}}
 
{{RBBottom}}
 
{{RBBottom}}
<noinclude>
+
</includeonly>
Current modifications:
+
 
* Removed the "World" parameter. Added subpages to the [[Template:RealmBox]] to auto-grab the world number from the required "Island" parameter.
+
<noinclude>{{DocSubpage}}
* 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.
+
Complete revamp to use external data API.
 +
 
 +
<pre><nowiki>{{RealmBox|world|realmid|titletextcolor}}</nowiki></pre>
 +
 
 +
TitleTextColor is optional. Recommended if your realm color is really dark, or you won't be able to read the text on the title bars.
 +
 
 
</noinclude>
 
</noinclude>

Latest revision as of 02:37, 19 February 2020


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.

{{RealmBox|world|realmid|titletextcolor}}

TitleTextColor is optional. Recommended if your realm color is really dark, or you won't be able to read the text on the title bars.