Difference between revisions of "Template:RealmBox/Sandbox"

From BattleMaster Wiki
Jump to navigation Jump to search
m
m (Fixed minor bracket mistake; made FlagSize default to a non-rendered caption)
 
(37 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}}}}
+
{{RBTitle
{{RBImage|Image = {{{Flag|}}}|TextStyle = normal|Caption ={{{FlagCaption|}}}}}
+
|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<br>{{#if: {{{StateReligion|}}} | State Religion<br>|}}Duchies<br>Regions<br>{{#if: {{{Nobles|}}} | Nobles<br>|}}Population<br>{{#if: {{{Food|}}} | Food<br>|}}{{#if: {{{Gold|}}} | Gold<br>|}}</b>
+
|Left =
|Right = [[Located on::{{{Island|{{c|red|You must specify an "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|You must specify the "Government" type}}}}}]]<br>{{#if: {{{StateReligion|}}} | [[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}}<br>{{#if: {{{Nobles|}}} | {{{Nobles|Unknown}}}<br>|}}{{#ask: [[part of::{{PAGENAME}}]] | ?population= | mainlabel=- | format = sum | default = 0}}<br>{{#if: {{{Food|}}} | {{{Food|Unknown}}}<br>|}}{{#if: {{{Gold|}}} | {{{Gold|Unknown}}}|}}}}
+
<b>Island
{{RBTitle|TextColor = {{{TitleTextColor|black}}}|BackColor = {{{TitleBackColor|#aabbcc}}}|Text = Council}}
+
Capital
{{RBDouble|BackColor = #CCCCCC|Left = {{{RulerTitle|King}}}|Right = [[has ruler::{{{RulerName|{{c|red|You must specify the "RulerName"}}}}}]]}}
+
<br>Government
{{RBDouble|Left = <b>{{{GeneralTitle|General}}}<br>{{{BankerTitle|Banker}}}<br>{{{JudgeTitle|Judge}}}</b>|Right = [[has general::{{{GeneralName|{{c|red|You must specify the "GeneralName"}}}}}]]<br>[[has banker::{{{BankerName|{{c|red|You must specify the "BankerName"}}}}}]]<br>[[has judge::{{{JudgeName|{{c|red|You must specify the "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}}
 +
</includeonly>
 +
 +
<noinclude>{{DocSubpage}}
 +
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>

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.