Difference between revisions of "Template:RealmBox"

From BattleMaster Wiki
Jump to navigation Jump to search
m
 
(105 intermediate revisions by 7 users not shown)
Line 1: Line 1:
<includeonly>{{RBTop}}
+
<includeonly>{{#get_web_data:url=https://battlemaster.org/data/realm/{{{World|{{{1}}}}}}/{{{RealmID|{{{2}}}}}}
 +
|format=XML
 +
|use xpath
 +
|data=
 +
Island=realmdata/continent,
 +
TitleBackColor=realmdata/colour,
 +
Realm=realmdata/name,
 +
Capital=realmdata/capital,
 +
FullName=realmdata/fullname,
 +
Government=realmdata/system,
 +
Duchies=realmdata/duchycount,
 +
RulerTitle=realmdata/rulertitle,
 +
RulerName=realmdata/rulername,
 +
GeneralTitle=realmdata/generaltitle,
 +
GeneralName=realmdata/generalname,
 +
JudgeTitle=realmdata/judgetitle,
 +
JudgeName=realmdata/judgename,
 +
BankerTitle=realmdata/bankertitle,
 +
BankerName=realmdata/bankername,
 +
Regions=realmdata/regioncount,
 +
Population=realmdata/population,
 +
Gold=realmdata/gold,
 +
Food=realmdata/food,
 +
Nobles=realmdata/nobles,
 +
}}
 +
{{RBTop}}
 +
{{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="https://battlemaster.org/experimental/RealmMap.php?shownames=regions&onlyRealm=yes&World={{{World|{{{1}}}}}}&Realm={{{RealmID|{{{2}}}}}}" height="{{{MapHeight|237}}}" width="{{{MapWidth|313}}}"> |}}
 
{{RBTitle
 
{{RBTitle
|TextColor = {{{TitleTextColor|black}}}
+
|TextColor = {{{TitleTextColor|{{{3|Black}}}}}}
|BackColor = {{{TitleBackColor|#aabbcc}}}
+
|BackColor = {{{TitleColor|{{{4|{{#external_value:TitleBackColor}}}}}}}}
|Text = {{{RealmName}}}}}
+
|Text = Overview}}
{{RBImage
+
{{RBDouble
|Image = {{{Flag}}}
+
|LeftTextWeight = bold
|TextStyle = normal
+
|BorderBottomStyle = hidden
|Caption = {{{FlagCaption}}}}}
+
|Left = Island
 +
|Right = [[Located on::{{#external_value:Island}}]]
 +
}}
 +
{{RBDouble
 +
|LeftTextWeight = bold
 +
|BorderBottomStyle = hidden
 +
|Left = Capital
 +
|Right = [[{{#external_value:Capital}}]]
 +
}}
 +
{{RBDouble
 +
|LeftTextWeight = bold
 +
|BorderBottomStyle = hidden
 +
|Left = Largest City
 +
|Right = {{#ask: [[part of::{{#external_value:Realm}}]] [[is regiontype::Stronghold||City]] | limit = 1 | sort = population | order = desc | searchlabel= | default=Unknown}}
 +
}}
 +
{{RBDouble
 +
|LeftTextWeight = bold
 +
|BorderBottomStyle = hidden
 +
|Left = Government
 +
|Right = [[government type is::{{#external_value:Government}}]]
 +
}}
 +
{{#if: {{{StateReligion|}}} | {{RBDouble
 +
|LeftTextWeight = bold
 +
|BorderBottomStyle = hidden
 +
|Left = State Religion
 +
|Right = [[has state religion::{{{StateReligion}}}]]
 +
}}}}
 
{{RBDouble
 
{{RBDouble
|Left = <b>Island<br>Capital<br>Largest City<br>Duchies<br>Government Type<br>Regions<br>Nobles<br>Population<br>Food Production</b>
+
|LeftTextWeight = bold
|Right = [[Located on::{{{Island}}}|{{{Island}}}]]<br>{{{Capital}}}<br>{{{LargeCity}}}<br>{{{Duchies}}}<br>{{{Government}}}<br>{{{Regions}}}<br>{{{Nobles}}}<br>[[population::{{{Population}}}]]<br>{{{Food}}}}}
+
|BorderBottomStyle = hidden
 +
|Left = Duchies
 +
|Right = {{#external_value:Duchies}}
 +
}}
 +
{{RBDouble
 +
|LeftTextWeight = bold
 +
|BorderBottomStyle = hidden
 +
|Left = Regions
 +
|Right = {{#ask: [[part of::{{#external_value:Realm}}]] [[is regiontype::+]] | format = count | default=Unknown}}
 +
}}
 +
{{RBDouble
 +
|LeftTextWeight = bold
 +
|BorderBottomStyle = hidden
 +
|Left = Population
 +
|Right = [[population::{{#ask: [[part of::{{#external_value:Realm}}]] | ?population | format = sum | default = 0}}]]
 +
}}
 +
{{RBDouble
 +
|LeftTextWeight = bold
 +
|BorderBottomStyle = hidden
 +
|Left = Gold
 +
|Right = [[gold::{{#external_value:Gold}}]]
 +
}}
 +
{{RBDouble
 +
|LeftTextWeight = bold
 +
|BorderBottomStyle = hidden
 +
|Left = Food
 +
|Right = [[food::{{#external_value:Food}}]]
 +
}}
 +
{{RBDouble
 +
|LeftTextWeight = bold
 +
|Left = Nobles
 +
|Right = [[nobles::{{#external_value:Nobles}}]]
 +
}}
 
{{RBTitle
 
{{RBTitle
|TextColor = {{{TitleTextColor}}}
+
|TextColor = {{{TitleTextColor|{{{3|Black}}}}}}
|BackColor = {{{TitleBackColor}}}
+
|BackColor = {{{TitleColor|{{{4|{{#external_value:TitleBackColor}}}}}}}}
 
|Text = Council}}
 
|Text = Council}}
 
{{RBDouble
 
{{RBDouble
 
|BackColor = #CCCCCC
 
|BackColor = #CCCCCC
|Left = {{{RulerTitle|King}}}
+
|LeftTextWeight = bold
|Right = {{{RulerName}}}}}
+
|Left = {{#external_value:RulerTitle}}
 +
|Right = [[has ruler::{{FamilyName|{{{World|{{{1}}}}}}|{{#external_value:RulerName}}}}| ]] {{FamilyLink|{{{World|{{{1}}}}}}|{{#external_value:RulerName}}}} }}
 
{{RBDouble
 
{{RBDouble
|Left = <b>{{{GeneralTitle|General}}}<br>{{{BankerTitle|Banker}}}<br>{{{JudgeTitle|Judge}}}</b>
+
|LeftTextWeight = bold
|Right = {{{GeneralName}}}<br>{{{BankerName}}}<br>{{{JudgeName}}}}}
+
|BorderBottomStyle = hidden
{{RBTitle
+
|Left = {{#external_value:GeneralTitle}}
|BackColor = {{{TitleBackColor}}}
+
|Right = {{FamilyLink|{{{World|{{{1}}}}}}|{{#external_value:GeneralName}}}} {{#set: has general={{FamilyName|{{{World|{{{1}}}}}}|{{#external_value:GeneralName}}}} }}
|TextColor = {{{TitleTextColor}}}
+
}}
|Text = Regions}}
+
{{RBDouble
 +
|LeftTextWeight = bold
 +
|BorderBottomStyle = hidden
 +
|Left = {{#external_value:JudgeTitle}}
 +
|Right = {{FamilyLink|{{{World|{{{1}}}}}}|{{#external_value:JudgeName}}}} {{#set: has judge={{FamilyName|{{{World|{{{1}}}}}}|{{#external_value:JudgeName}}}} }}
 +
}}
 
{{RBDouble
 
{{RBDouble
|Left = {{{RegionNames}}}
+
|LeftTextWeight = bold
|Right = {{{RegionLords}}}}}
+
|Left = {{#external_value:BankerTitle}}
 +
|Right = {{FamilyLink|{{{World|{{{1}}}}}}|{{#external_value:BankerName}}}} {{#set: has banker={{FamilyName|{{{World|{{{1}}}}}}|{{#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>
+
[[Category:Realms]][[Category:{{#external_value:Island}}]][[Category:{{#external_value:Realm}}]]</includeonly>
==Intro==
+
<noinclude>{{SemanticCodes}}{{Documentation}}[[Category:RealmBox]]</noinclude>
'''This is an experimental template for exploring the [[Semantic Wiki]] project.''' You should not use this for your realm.
 
 
 
This template is part of the [[RealmBox Project]].
 
 
 
This template calls other RealmBox templates to create a complete RealmBox. It is pre-configured to provide much more detail than [[Template:RBRealmOne]]. All you need to do is invoke this one single template, and it calls all the RealmBox templates needed.
 
 
 
Certain parameters in this template are automatically tagged for the [[Semantic Wiki]]. These properties are noted in their descriptions below.
 
 
 
==Parameters==
 
All parameters, vertical format:
 
* RealmName - The name of the realm.
 
* TitleBackColor - The color code for the title bar backgrounds.
 
* TitleTextColor - The color code of the title bar text.
 
* Flag - The name of the image file to use at the top of the RealmBox. Must be an image uploaded to the wiki. Do not include the "Image:" part of the name.
 
* FlagCaption - A caption to go under the image.
 
* RulerTitle - Ruler's custom title.
 
* RulerName - Ruler's name.
 
* GeneralTitle - General's custom title.
 
* GeneralName - General's name.
 
* JudgeTitle - Judge's custom title.
 
* JudgeName - Judge's name.
 
* BankerTitle - Banker's custom title.
 
* BankerName - Banker's name.
 
* Island - The name of the island on which the realm is located.
 
* Capital - The name of the capital city. You can use [[Template:Reglink]] to link it to the wiki page for the region.
 
* LargeCity - The name of the largest city. You can use [[Template:Reglink]] to link it to the wiki page for the region.
 
* Duchies - The number of duchies in the realm.
 
* Government - The government type: Monarchy, Theocracy, etc.
 
* Regions - The number of regions in the realm.
 
* Nobles - The number of nobles in the realm.
 
* Population - The approximate population of the realm.
 
* Food - The approximate food production of the realm.
 
* RegionNames - The names of the region of the realm, separated by <nowiki><br></nowiki>. You can use [[Template:Reglink]] to link them to the wiki page for the region.
 
* RegionLords - The names fo the region lords, in the same order as the regions, separated by <nowiki><br></nowiki>.
 
 
 
 
 
==Template==
 
You can copy/paste the following guide into your page, then add the values.
 
 
 
<pre>
 
{{RBRealmOne
 
|RealmName =
 
|TitleBackColor =
 
|TitleTextColor =
 
|Flag =
 
|FlagCaption =
 
|RulerTitle =
 
|RulerName =
 
|GeneralTitle =
 
|GeneralName =
 
|JudgeTitle =
 
|JudgeName =
 
|BankerTitle =
 
|BankerName =
 
|Island =
 
|Duchies =
 
|Regions =
 
|Nobles =
 
|Population =
 
|Capital =
 
|LargeCity =
 
|Duchies =
 
|Government =
 
|Nobles =
 
|Population =
 
|Food =
 
|RegionNames =
 
|RegionLords =
 
}}
 
</pre>
 
[[Category:RealmBox]]
 
</noinclude>
 

Latest revision as of 01:29, 27 January 2022

Template-info.svg Semantic Coded Template
This template contains semantic coding. Do not use this template for anything other than its intended purpose.
Template-info.svg Template Documentation
This documentation is transcluded from Template:RealmBox/doc.

ExamplesSandbox

Intro

This template is part of the RealmBox Project. It is enabled for importing of the game's external data feed, and for semantic coding of the included data. This template uses all available semantic coding at the realm level, with the exception of the realm founding date and realm founder.

  • There are a few parameters that are required to be included. These are identified in the parameter list below.
  • Nearly all data in this infobox is pulled directly from the game. You cannot manually specify this information.

NOTE: The template includes the realm category, Category:Realms, and the appropriate island category. If you use this template, you do not need to manually add these categories to your page.

Using the Template

Copy one of the blank templates provided at the bottom of this page.

Special Considerations

  • If you want a map in your RealmBox, then you will need to specify a "MapName = " parameter. Due to the way the wiki handles off-site image links, the spaces in the realm map names will cause problems. If your realm name has spaces in it you need to encode them as "%20". This will allow the wiki to show the map. For example, if you are putting a map in the RealmBox for "Pian en Luries", you need to include the parameter "MapName = Pian%20en%20Luries".

Parameters

This section lists all the available parameters for use with the template. It is split into two sections; "Required" and "Optional".

Required

This is a listing of the required parameters.

  • World = Required. The world number the realm is on. EC=1, AT=2, BT=4, Col=6, FEI=7, DW=8.
  • RealmID = Required. The ID number of the realm. You can get this from the island realm list. The URL of the "Details" link provides this number. Examples: "https://battlemaster.org/testing/RealmDetails.php?ID=12" shows 12 as the RealmID for Astrum on Dwilight.

Optional

  • TitleTextColor - The color code of the title bar text. Defaults to black. (#000000)
  • TitleColor - The color code of the background of the title bars. Defaults to the realm color set by the realm's ruler. This is the color used for the realm of the diplomacy chart and stats graphs.
  • Flag - The name of the image file to use at the top of the RealmBox. Must be an image uploaded to the wiki. Do not include the "Image:" part of the name. Leave blank if you don't want a flag displayed.
  • FlagSize - An image format or size parameter.
  • FlagCaption - A caption to go under the flag image. Ignored if Flag is is not specified.
  • MapName - If you want a map in your RealmBox, then enter the realm name here. You must replace all spaces with "%20", This is because of the way the wiki handles off-site image links. For example, to include a map for "Pian en Luries", you would enter "Pian%20en%20Luries". If your realm is very wide, this will make your RealmBox very wide, too.
  • MapHeight - Height of map. Numbers only.
  • MapWidth - Width of map. Numbers only.
  • StateReligion - The official state religion of the realm.
  • Nobles - The number of nobles in the realm.
  • Food - The approximate food production of the realm.
  • Gold - Gold production of the realm.

Template

You can copy/paste the following guide into your page, then add the values.

Minimal RealmBox

This provides the minimum parameters needed to add a RealmBox to your realm page.

{{RealmBox
|World = 
|RealmID = 
}}

Full RealmBox

This provides the complete list of parameters that can be used with RealmBox. You can pick and choose which one you want, so long as you provide the two required parameters.

{{RealmBox
|World = 
|RealmID = 
|TitleColor = 
|TitleTextColor = 
|MapName = 
|Flag = 
|FlagCaption = 
|Nobles = 
|Food = 
|Gold = 
}}

Alternate Method

RealmBox supports inline parameters for basic usage, like this:

{{RealmBox|(World)|(RealmID)|(TitleColor)|(TitleTextColor)}}

Just replace the items in parentheses with the actual values. For example, the RealmBox for Astrum could be specified as:

{{RealmBox|8|12|Blue|White}}

Note that with this method, you can only provide the Four listed parameters.

Known Issues

  • The SUM output format for semantic queries inserts a line break before the value. This seems the be a "feature" of the semantic output formats extension. The means the Population figure is about a half-line below where it should be. I don't know how to force it back to where it should be. Maybe some HTML/CSS guru can fix it.