Decyclomedia Foundation:Decyclomedia Incubator/Estranhapedia/Predefinição:Infobox/doc

From Decyclopedia
Jump to navigation Jump to search

There are three methods to create an infobox with portability (correct display on both desktop and mobile browsers):

  1. use a single-use infobox
  2. create an infobox template from scratch
  3. modify an infobox template from an infobox that already exists

A portable single-use infobox may be found on Templates Wikia; Help:Infoboxes can show how an infobox is made using the easy interface at Special:InfoboxBuilder. The purpose of this template is facilitate that third method: it is a basic infobox for copying to a new location and editing in source mode.

Creating a new infobox from this one[edit source]

This template makes it easy to get a working infobox going for the user to edit. You should begin by copying the infobox to a new location - don't edit this page, make a copy first.

This Createbox will help make the new page. Think about if you want an Infobox Character, an Infobox Item, or Infobox Whatever - then type it below, hit the button and save the page immediately (a copy of the code will be provided). Get ready to come back to this page for instructions on how to continue.

<createbox> prefix=Template: preload=Template:Infobox buttonlabel=Make your infobox! default = Infobox Foo </createbox>

Changing parameters[edit source]

Besides the title, image, and image caption, there are eight data parameters on this infobox. They are not particularly useful fields as they are - "first", "second", "third", "fourth", "fifth", "sixth" - though "previous" and "next" may prove generically useful for some purposes.

Hit "Edit" and look at the code. Every line that begins with <data is a data parameter. They look like this:

<poem style="font-family:monospace; color:red;"> <data source="first"><label>First parameter</label><default>''Unknown''</default> </poem>

  • First parameter is the label that appears on the finished infobox, like that on the top of this page.
  • first is the parameter name that is displayed in the template's syntax as | first =, then filled out on another page.
  • <default>''Unknown''</default> defines what should be displayed if the parameter is left blank. Two apostrophes around a word italicizes it: Unknown.

Think about what labels you would like your finished infobox to have - an Infobox Item might have "Price", "Effects", "Weight", for instance, but an Infobox Character probably would have others - and then change the labels to match. Change the parameter names too - they don't have to be the same as the labels at all. If you run out of data parameters, just copy one of the others directly below itself; you can remove parameters too.

If you want a parameter to be hidden if it's blank, then remove the <default>''Unknown''</default>.

Note that the last two parameters are within a <group layout="horizontal">...</group> tag, which means that they display side-by-side. If you don't like that, then you may remove the <group layout="horizontal"> opening tag and the </group> that closes it.

Changing headers[edit source]

There are three headings in the default infobox: "Some attributes", "Other attributes", and "Order". They are easy to change or remove. In the code, they look like this:

<poem style="font-family:monospace; color:green;"> <header>Some attributes</header> </poem>

To change these headers, just edit the Some attributes to be whatever you want; if you don't want a heading at all, then remove the <header>...</header> and everything inside of it. If you want a heading where there isn't one, then copy the above code to the point in the infobox where you want it.

Documentation[edit source]

Once you have created your new infobox, you should create a blank syntax for copying to pages that shall use that infobox. It should look like the syntax below, but with the parameter names you added in instead. Put that syntax in a /doc subpage for your template, like Template:Infobox Whatever/doc, so that the documentation template displays it on the template page itself for anyone who wants to use it.

See also[edit source]

Syntax of this template[edit source]

This template ought not to be transcluded into articles before a copy is made, but if you did transclude it, you would copy the following to an article, and then fill it out:

 | title         = 
 | image         = <!-- Example.jpg -->
 | imagecaption  = 
 | first         =
 | second        =
 | third         =
 | fourth        = <!-- hidden by default -->
 | fifth         = <!-- hidden by default -->
 | sixth         = <!-- hidden by default -->
 | previous      =
 | next          =

Changing just the syntax of a template does NOT create a parameter, so | seventh = Foo wouldn't have any effect if it were inserted in the above. See the above section for how to change parameters.

Categoria:Documentações de predefinições