RealmBox Project/Planning

From BattleMaster Wiki
Jump to navigation Jump to search

NOTE
The information on this page was used for planning purposes, may not be completely up to date, and/or may be just plain wrong. Refer to the RealmBox Project/Instructions and the individual template pages for specific information.


Terminology

  • Realmbox
    A "realmbox" is the aggregate grouping of all the various components that comprise one implementation of the template.
  • Block
    A block is an individual component, many of which join together to form a complete realmbox. Each block will carry a specific piece of information, such as the ruler name and title, or the capital city.

Common Parameters

The following parameters need to be shared across many different blocks of the realmbox. They should be kept to a minimum, as a new page will most likely need to be created for each one. Users should be able to override the colors in each block separately, if desired. Defaults should be provided for each parameter so meaningful output is provided even the user doesn't implement it properly. Defaults *may* not be possible, though. I have to think on that.

Required

Although not strictly required, these should be customized by the user to provide a personalized look.

  • Realm color
    The color to use as a highlight background for key block, such as realm name, etc. Default: White Name: RBRealmColor
  • Title color
    The color of text that will appear in blocks that use the realm color. Default: Black Name: RBTitleColor

Optional

These parameters will normally be left empty for most implementations. They are provided for those who wish to get more creative.

  • Border color
    This will be the color used for the border lines of the realmbox. Default: Black Name: RBBorderColor
  • Background color
    The overall background color of the realmbox. Default: White Name: RBBackColor
  • Text color
    The color of the normal text in the realmbox. Default: Black Name: RBTextColor

Common Parameters

These parameters should be supported by most blocks. If they are supported they will have the same name, and accept the same values. Any special exceptions should be annotated in the template description. For a complete list of the acceptable parameters and values, refer to the specific template description.

  • Align
    The alignment of the text. Valid values are: left, center, right


Blocks

The following blocks should be available:

  • Top Block
    This is the opening block of the realmbox. It will contain the opening table elements of the realmbox, plus some extra CSS elements. It is a required block. I still need to experiment and investigate what types of things should be in this one.
  • Align
    Sets the alignment of the box on the page. Default: Right
  • Width
    The width of the realmbox. It can be entered in any valid measurement unit (px, %, etc.) Default: 315px
  • Title Block
    A title block is a single column block that will occupy the full width of the realmbox. It will use the "realm color" and "title color". The following parameter should be provided:
  • Text
    This is the text that will appear in the block.
  • IG Realm Map Block
    For the display of the realm map created by the game. Requires two parameters:
  • Realm Number
    1 for Perdan, 3 for Sirion, etc... You get this by viewing the Details link from the Realm list.
  • World Number
    1 for East Island, 2 for Atamara, etc....
  • Wiki Image Block
    A generic block used to display any wiki image. This can be used to display a coat of arms, a flag, a non-game generated map, or anything else. Requires one parameter:
  • Image name
    The name of the image to be displayed. Do not include the "Image:" portion, just the name.
  • Single Column Block
    A single block that occupies the entire width of the realmbox column. Basically the same as the Title Block except it defaults to the "background color" and "text color". Requires the following parameter:
  • Text
    The text to appear in the box.
  • Double Column Block
    A two column block. The left column normally holds some category (Ruler, Capital, etc.) and the right column holds a value (ruler's name, population figure, etc.) Requires the following parameters:
  • Left
    The text in the left column. Should be bold. Maybe default to bold, and allow an override?
  • Right
    The text in the right column. Should be normal text.
  • Bottom Block
    This will be the closing block that ends the realmbox table. It is a required block. It accepts no parameters.

Note: Comments can be placed inside any block by using a parameter name that is not used by that block. For this reason the parameter name of "Comment" is reserved for use by the template users. It should not be included in the design of any block.

Parameters Supported by Each Block

Each template's page includes a complete listing of parameters supported by the block, including the default value of that parameter.

Implementation

The realmbox will be implemented using a table created with wiki table syntax. The inspiration for this comes from Template:Userboxtop and Template:Userboxbottom. The idea is to put the opening part of the table markup in the RBTop template, each row in a separate RBBlock template, and then put the table closing line in the RBBottom template. When the user places the templates on the page in the proper order, they are replaced with the wiki code, and then assembled into a complete table byt the wiki parser.

Code Division

Each block will need to contain the wiki table markup for it's own row, starting with the opening tag for the row, but not the closing tag. For example:

  • RBTop opens the table:
{| border="1"
  • RBDouble adds a row:
|-
| {{{Left}}} || {{{Right}}}
  • RBSingle adds another row:
|- 
| colspan="2" style="text-align: center;" | {{{Text}}}
  • RBBottom close the table with:
|}

When all four templates are called in a row, they come together as a complete table:

{| border="1"
|-
| {{{Left}}} || {{{Right}}}
|-
| colspan="2" style="text-align: center;" | {{{Text}}}
|}

Which renders as:

{{{Left}}} {{{Right}}}
{{{Text}}}

Sample Concept Code

The following is how a basic realmbox would look when a user implements it on their page. It looks nearly the same as one fo the standard, customized infoboxes in general use now. To make it simpler to use, we could provide various sample boxes that people could copy/paste and just fill in the blanks. Anyone wanted to get more involved could easily do so by mixing and matching their own blocks.

{{RBTop}}
{{RBTitle
|text = Keplerstan}}
{{RBImage
|Comment = Our flag
|File = Keplerflag.png}}
{{RBImage
|Comment = beloved ruler
|File = KingKepler.png}}
{{RBMap
|Realm = 1
|Island = 1}}
{{RBTitle
|Text = The Council}}
{{RBSingle
|background color = #CCCCCC
|Comment = the King gets a special colored background
|Text = King {{Kepler Family\Kepler|Kepler Kepler}}}}
{{RBSingle
|background color = #CCCCCC
|Text = Judge Joe<br>General Tom<br>Banker Tim}}
{{RBTitle
|Text = The Realm}}
{{RBDouble
|Left = Capital<br>Population<br>Duchies<br>Regions<br>
|Text = {{Reglink|ZZ|Keplerstani}}<br>123,456<br>2<br>10}}
{{RBBottom}}