Template:Mechs by Area/documentation

From MechQuest Wiki
Jump to: navigation, search

Syntax

Base Version

{{Mechs by Area
 |title=
 |col1=
 |list1=
 |col2=
 |list2=
 |col3=
 |list3=
 |col4=
 |list4=
 |col5=
 |list5=
 |col6=
 |list6=
 |col7=
 |list7=
 |col8=
 |list8=
 |col9=
 |list9=
 |col10=
 |list10=
 |col11=
 |list11=
 |col12=
 |list12=
 |col13=
 |list13=
 |col14=
 |list14=
 |col15=
 |list15=
 |col16=
 |list16=
 |col17=
 |list17=
 |col18=
 |list18=
 |col19=
 |list19=
 |col20=
 |list20=
 |col21=
 |list21=
 |col22=
 |list22=
 |col23=
 |list23=
 |col24=
 |list24=
 |col25=
 |list25=
}}

Full Version

{{Mechs by Area
 |tableborder=
 |bgcolor=
 |bgopacity=
 |tablepadding=
 |tablemargin=
 |talign=
 |tsize=
 |width=
 |titlebgcolor=
 |titletformat=
 |titletsize=
 |titlepadding=
 |titletalign=
 |title=
 |col1bgcolor=
 |col1tformat=
 |col1padding=
 |col1talign=
 |col1=
 |list1bgcolor=
 |list1tformat=
 |list1padding=
 |list1talign=
 |list1=
 |col2bgcolor=
 |col2tformat=
 |col2padding=
 |col2talign=
 |col2=
 |list2=
 |col3bgcolor=
 |col3tformat=
 |col3padding=
 |col3talign=
 |col3=
 |list3=
 |col4bgcolor=
 |col4tformat=
 |col4padding=
 |col4talign=
 |col4=
 |list4=
 |col5bgcolor=
 |col5tformat=
 |col5padding=
 |col5talign=
 |col5=
 |list5=
 |col6bgcolor=
 |col6tformat=
 |col6padding=
 |col6talign=
 |col6=
 |list6=
 |col7bgcolor=
 |col7tformat=
 |col7padding=
 |col7talign=
 |col7=
 |list7=
 |col8bgcolor=
 |col8tformat=
 |col8padding=
 |col8talign=
 |col8=
 |list8=
 |col9bgcolor=
 |col9tformat=
 |col9padding=
 |col9talign=
 |col9=
 |list9=
 |col01bgcolor=
 |col01tformat=
 |col01padding=
 |col01talign=
 |col10=
 |list10=
 |col11bgcolor=
 |col11tformat=
 |col11padding=
 |col11talign=
 |col11=
 |list11=
 |col12bgcolor=
 |col12tformat=
 |col12padding=
 |col12talign=
 |col12=
 |list12=
 |col13bgcolor=
 |col13tformat=
 |col13padding=
 |col13talign=
 |col13=
 |list13=
 |col14bgcolor=
 |col14tformat=
 |col14padding=
 |col14talign=
 |col14=
 |list14=
 |col15bgcolor=
 |col15tformat=
 |col15padding=
 |col15talign=
 |col15=
 |list15=
 |col16bgcolor=
 |col16tformat=
 |col16padding=
 |col16talign=
 |col16=
 |list16=
 |col17bgcolor=
 |col17tformat=
 |col17padding=
 |col17talign=
 |col17=
 |list17=
 |col18bgcolor=
 |col18tformat=
 |col18padding=
 |col18talign=
 |col18=
 |list18=
 |col19bgcolor=
 |col19tformat=
 |col19padding=
 |col19talign=
 |col19=
 |list19=
 |col20bgcolor=
 |col20tformat=
 |col20padding=
 |col20talign=
 |col20=
 |list20=
 |col21bgcolor=
 |col21tformat=
 |col21padding=
 |col21talign=
 |col21=
 |list21=
 |col22bgcolor=
 |col22tformat=
 |col22padding=
 |col22talign=
 |col22=
 |list22=
 |col23bgcolor=
 |col23tformat=
 |col23padding=
 |col23talign=
 |col23=
 |list23=
 |col24bgcolor=
 |col24tformat=
 |col24padding=
 |col24talign=
 |col24=
 |list24=
 |col25bgcolor=
 |col25tformat=
 |col25padding=
 |col25talign=
 |col25=
 |list25=
}}

Explanation of Individual Fields

Using the Basic Template

The core template is pretty easy to learn, even if its length looks daunting at first. Only three new variable-field-thingys to learn, and you can create decent item listings without having to add secondary fields.

Secondary fields, described below (with some examples to show any additional requirements) provide several formatting options. If you don't like the defaults, you can change many of the values for different usages.

The maximum number of rows you can use is 25, but if you don't need that many, delete the excess amount of col- and list- fields. They won't show up in the final table.


 |title=
Simple enough. This field is meant to hold the title of whatever it is that you're doing. For example, our example table (located further down) provides a partial listing of planets and their respective towns, so it's named "Planets and Towns." In template format, it would look like this:
 |title=Planets and Towns

––––––––––

 |col1=
This field is here to help you enter information in the template's table formatting. It's the leftmost of two fields, and is often used to enter things like names or generalized info. However, there are many possible usages. Continuing with our example, one way the field could be used is listing a single planet, like this:
 |col1=[[Lore]]

––––––––––

 |list1=
Counterpart to the left-hand column, this is generally used for longer, detailed lists, but there are no absolutes. To use another example from our "Planets and Towns" chart:
 |list1=[[Soluna City]], [[GEARS University]]

Using the Full Template

In addition to the core template described above, this version of the Navigation Box has a range of fully customizable values for individual cells. The nice thing about it is that the default and full versions are based on the same template code, so if you find that the only thing you want to change is the title background color you can dispense with the rest of the options.


 |width=
Changes the total table width. No more squashed clunky navbox!
Syntax: Just enter the number of pixels you want it wide.
 |width=800px

––––––––––––––––––––––––––––––

 |tableborder=
The default value for this is 0. If you raise it, a little black border will appear around individual cells. As far as I understand, the effect is global.
Syntax: It's pretty simple when compared with some parameters. All you have to do is enter a number, with the exact numbers determining how wide your resulting borders will be. Of course, entering 15 would probably produce more border than anything else.
 |tableborder=15

––––––––––

 |tablemargin=
Changes the table margin, which is the little dark gray line you see around the edges of the table itself (not cells, there's another setting for that effect.) I have no idea how this works, so I shall leave the syntax out and hope somebody is kind enough to tell me. The defaults will probably work in most cases anyway.

––––––––––

 |bgopacity=
This determines the table's opacity. Frankly, I have no idea why this was in the original navbox at all, but somebody's bound to figure it out sooner or later.

––––––––––

 |bgcolor=
This determines the table's background color, NOT individual cell background colors. There's another field for that.
Syntax: This field accepts normal colorizing for the most part. (Somebody confirm HTML color markup as being the correct term....) However, its only requirement is that you must enter a # before whatever color value you pick.
 |bgcolor=#ff0000

––––––––––

 |talign=
Changes the global alignment for all text entered into titles, columns, or lists. Any custom settings you specify for individual cells will still be applied.
Syntax: Left, right, or center, with the default value being left. Oddly enough, all the individual cell listings use centered text if nothing is specified in their individual fields, so this is rather useless right now. However, I may edit the template to reflect global specifications more accurately in the future.
 |talign=right

––––––––––

 |tsize=
Changes the global text size in percentage values.
Syntax: All you have to do is enter a percentage value and the text size will be changed. However, individually-set values override this.
 |tsize=120%

––––––––––

 |tablepadding=
Changes the amount of empty space in between cells.
Syntax: This is one of the pickier values....(In reality, 10 pixels by 10 pixels would produce a lot of white space, but it does provide an example.)
 |tablepadding=10px 10px

––––––––––––––––––––––––––––––

 |titletsize=
Changes the title row's text size in percentage values.
Syntax: Enter a percentage value and the text size will be changed. This overrides the globally set values, but only for that particular cell. Right now you can't change individual cell text size anyway, so you're stuck with specifying it for the whole table.
 |titletsize=120%

––––––––––

 |titlebgcolor=
 |col1bgcolor=
 |list1bgcolor=
This determines its corresponding cell's background color, not table background color. We already covered that.
Syntax: It accepts regular color-changing code, as for entering the table background color, but make sure you enter a # before your color value (unless you're using non-standard codes).
 |titlebgcolor=#ff0000
 |col1bgcolor=#ff0000
 |list1bgcolor=#ff0000

––––––––––

 |titletformat=
 |col1tformat=
 |list1tformat=
This changes individual cell text from regular to bold and/or italic.
Syntax:
 |titletformat=bold
 |col1tformat=bold
 |list1tformat=bold

––––––––––

 |titlepadding=
 |col1padding=
 |list1padding=
Changes the amount of empty space around cell text. This also overrides the global parameter (Would it be any use if it didn't?)
Syntax: Again, picky value!
 |titlepadding=10px 10px
 |col1padding=10px 10px
 |list1padding=10px 10px

––––––––––

 |titletalign=
 |col1talign=
 |list1talign=
Changes text alignment for the respective cell.
Syntax: Left/right/center values.
 |titletalign=right
 |col1talign=right
 |list1talign=right

And the pattern continues. While I could continue explaining, I won't bore you all with more codes to memorize :p The template codes provided further above should help you understand how everything works when put together.

Example

Example Code

{{Mechs by Area
 |width=300px
 |titlebgcolor=#d5d5d5
 |titletformat=bold
 |title=Planets and Towns
 |col1bgcolor=#d5d5d5
 |col1tformat=bold
 |col1=Major Planets
 |list1bgcolor=#d5d5d5
 |list1tformat=bold
 |list1=Major Towns
 |col2=[[Lore]]
 |list2=[[Soluna City]], [[GEARS University]]
 |col3=[[Westion]]
 |list3=[[Alamonia Town|Alamonia]], [[Khaeldron]]
 |col4=[[Zargon]]
 |list4=[[Mechtropolis]]
 |col5bgcolor=#d5d5d5
 |col5tformat=bold
 |col5=Seasonal Planets
 |list5bgcolor=#d5d5d5
 |list5tformat=bold
 |list5=Seasonal Towns
 |col6=[[Mortis]]
 |list6=[[Amity]]
 |col7=[[Thoh]]
 |list7=[[Frostvale]]
 |col8bgcolor=#d5d5d5
 |col8tformat=bold
 |col8=Minor Planets
 |list8bgcolor=#d5d5d5
 |list8tformat=bold
 |list8=Minor Towns
 |col9=Lore's [[Moon]]
 |list9=None
}}

Results In

Planets and Towns
Major Planets Major Towns
Lore Soluna City, GEARS University
Westion Alamonia, Khaeldron
Zargon Mechtropolis
Seasonal Planets Seasonal Towns
Mortis Amity
Thoh Frostvale
Minor Planets Minor Towns
Lore's Moon None

Notes

Known Issues

Apparently the bgcolor and bgopacity fields don't like each other very much. When you use them together, you'll get a white table background. Until I figure out why, I'd advise you to stay away from the bgopacity field if you want customized table background colors.

Regarding Testing and Feedback

If I need help figuring out what Variable X does, it'll be listed here. If you want to provide feedback on something raised here, you may do so either on its talk page or mine (the latter is preferred).

Currently, I have no idea what the table margin parameter does. I'd appreciate an explanation of the topic if you happen to have experience with it.
The width parameter needs to be tested further. It currently supports fixed table stretching in pixels, but I'm pretty sure it supports percentages as well. Also, if it overrides the default wrapping, what happens when you have a text field longer than your specified width? Does it still wrap, does your text get broken up onto two lines, or is the excess simply chopped off at the end?
http://mqwiki.com/w/Template:Mechs_by_Area/documentation
mqwiki.com
crawl=CC-MAIN-2017-47
37552
application/http; msgtype=response
sha1:PUXXLYU3WILKHVS7SGVOU7GQ2JE6EUJX
<urn:uuid:71ee0edd-57cd-49b4-a57e-cdc4e7263760>
2017-11-19T08:39:34Z
50.28.61.189
text/html
sha1:XR2Y7EMIXBRCHWA7YXAVURBUYKR3VEWX
<urn:uuid:d4c4bcbd-0bba-43c0-9b8d-35038d986ec7>
http://mqwiki.com/w/Template:Mechs_by_Area/documentation
response
<urn:uuid:bfc5935d-acaa-43ba-8d7d-ae820ae0adec>
robots: classic
hostname: ip-10-79-203-83.ec2.internal
software: Nutch 1.6 (CC)
isPartOf: CC-MAIN-2017-47
operator: Common Crawl Admin
description: Wide crawl of the web for November 2017
publisher: Common Crawl
format: WARC File Format 1.0
conformsTo: http://bibnum.bnf.fr/WARC/WARC_ISO_28500_version1_latestdraft.pdf