Jump to content

Module:MilAward/doc

From Wikipedia, the free encyclopedia

Usage

[edit]

Various templates use this data. Start with {{MilAward}} and make sure to check out the talk page for some stats and tests.

Data structure

[edit]

This module uses the structure: code = {Code = "xx", Description = "xx", Class="", RibbonImage="Ribbon - Question mark.png", PageLink="Wikipedia:WikiProject Orders, decorations, and medals", PostNom="", Country="None", Note="", Org="None", RecipCat="" },

  • xx : the UNIQUE code we use to access this record.
  • Description : Description to be used as Alt Description, so it will be used when producing the link
  • class: intended to be for the class of the award, it's turning out to be useful for other things as well
  • RibbonImage : File name of the file for the ribbon to be displayed
  • PageLink  : Name of Wiki Article which the specific award will link to
  • PostNom  : If this award has a Postnominal attached to it, enter that here or leave blank
  • Country.  : This should be obvious, but I haven't made a decision whether to use codes or country name
  • org: Organisation
  • RecipCat: Contents of this field are used as a category name. The idea is to add the person who's medal you've added to their page, to the category of recipients of that medal, automagically

Examples:

With different sizes:

What this does is it provides the data to various routines which combine it in different ways. For example, Ribbon will display just the image, but will link it to the link page. Desc displays the ribbon, then adds the description next to it. When a template calls one of the routines in the module, the {{{size}}} is replaced with the second un-named parameter when the template is called. That is passed on to this module to set the size of the image. The "PageLink" provides the name of an article on Wikipedia with no wikilinking. (In theory it could be a URL, but that's not preferred) The contents of the Description field can be any text which can be used as the "alt text" for an image link. Please be careful with this. Using links or curly braces "{}" or inverted commas '' etc can break that entry as well as, potentially, the rest of the entries in the template.

How this works, is that the first unnamed parameter when you call the template is used as the value to look up the corresponding value in this list. Once that value has been found, then the fields in that line are available to the module. These fields are combined in different ways to produce the specific formatting required for the template that called this module. For this reason, it's very important that this format is not broken or interfered with!

There are now named parameters.

  • code: The code for the medal
  • size: Size of the image

Still to be implemented

  • Country=yes - Add the display of country to the medal description. WIll have to figure out if I display just what's in the data or do an ISO lookup for a country name.
  • Class=no - Allow the turning off of the addition of what's in the "Class" field to the medal description
  • TextSize=xx - Allow the specification of the size of the text. Probably a percentage.
  • Org=yes - Allow the turning on of the display of the contents of the "Org" field
  • Notes=no - Allow the turning off of the display of the contents of the "Notes" field

A note on countries

[edit]

All the data is in one large lookup table rather than splitting it into files for each country. It just means it's easier to maintain and it's less likely to get busybodies interfering and rearranging things because the "Good Idea Fairy" told them it would be a good idea.

Editors should try to keep this as organised as possible. Search the file for your country's name. If there isn't any mention of it, then create a heading using a comment for your country and add any relevant entries there. Within the country heading, not a bad idea to create sub-headings for different things. Examples might be "Military/Civilian", "Arms of service", "Types of awards". This then can be duplicated on the Documentation page of this Module and will make more sense to new readers and ease of use for maintainers and editors.

The data in this module is self-documenting. Place the template {{tlx|MilAward Stats}] in your sandbox or any other page and you'll see what I mean.