Module:BadgeDisplay/doc

in Wikipedia, die vrye ensiklopedie

Hierdie is die dokumentasieblad vir Module:BadgeDisplay

Usage[wysig bron]

Please rather use the template I've created to use this data. {{Template:Badge Display}}.

Module:MilAward/data[wysig bron]

EDITORS PLEASE NOTE: Be VERY careful that you understand exactly what you are doing if you edit the data in the subpage file. If in doubt, add a topic on the talk page or ping me User:BoonDock with your questions.

Structure[wysig bron]

Note that I have set this up to use the structure: xx = {Code = "xx", Type = "", Description = "xx", Class="", Variation="", Image="XX", PageLink="XX", Country="ZAR", Note="", Org="SANDF", RecipCat="" },

  • xx : the UNIQUE code we use to access this record.
  • Description : Description to be used at the top of the display-box, so it will be used when producing the link
  • class: intended to be for the class of the badge, it's turning out to be useful for other things as well
  • Variation: Mainly whether it's cloth, metal etc. What it's made out of etc
  • Image : File name of the file for the badge to be displayed
  • PageLink  : Name of Wiki Article which the specific badge will link to
  • 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. Not being used at the moment


Examples:

Military Law Practitioner
(Qualification)
Black on Thatch beige, Embossed
Scales of Justice surrounded by a Laurel Wreath
Musician
(Qualification/Post)
Musician (SACB)
Black on Thatch beige, Embossed
Round badge. Lyre with a wreath


With different sizes:

61 Mech Operational Service Badge
(Service)
Black on Thatch beige, Embossed
Rectangular bar (upright) with a black dagger and three black lightning flashes angled diagonally across the blade
61 Mech Operational Service Badge
(Service)
Black on Thatch beige, Embossed
Rectangular bar (upright) with a black dagger and three black lightning flashes angled diagonally across the blade


You can also float left and right:

Equestrian Advanced
(Qualification)
Advanced
Black on Thatch beige, Embossed
Stirrup with a riding crop with a two black circles surrounding the stirrup
Explosive Ordnance Disposal (EOD)
(Qualification)
EOD Badge
Gilt and silver
Gilt metal ring and bomb, facing down, with silver coloured lightning flash


What this does is it provides the data to various routines which combine it in different ways.

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 shown in the examples. 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 image
  • size: Size of the image
  • float: left, right or none

A NOTE ON COUNTRIES[wysig bron]

Separation of countries didn't make sense. It is a lot easier to sort based on a field in the data

Let's please 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.

NOTE: the data in this module is now self documenting.