Extension:Capiunto/Infobox/Basic usage

Capiunto is a MediaWiki extension based on Scribunto allowing to write flexible Infoboxes. For Capiunto a basic knowledge of Lua is necessary. To read up on Lua the Lua for beginners Help page or MediaWiki Lua reference manual is useful.

Create an Infobox module
A Lua module is needed in order to set up an Infobox with Capiunto. This way you will be able to keep for example a certain design and structure and just pass data to the module which can be useful in various situations. For a complete documentation see Extension:Capiunto/Infobox.

Setting options for capiunto.create
You have different options for styling your Infobox and setting some basic options in this step. You can get overview over all ove them here. The attributes are based on CSS therefore it allows easy changing styles of every element of the Infobox. Via the  variable a title for the Infobox can be set. The Lua function  can be used to set the title of the Page as the title of the Infobox.

Another example is seting the borders of a infbox's body to the size of 10 Pixel and the color red with It is possible to change most of the styling of the infoboxes this way if wanted but there are also very convenient defaults.

Adding data to the Infobox
Adding data to the Infobox is rather simple. With the help of :addRow( label, data ) it's possible to add a new Row to the Infobox with a label and data.

In the example below, three chemical elements and their symbols are being added to the Infobox. This data is static and can't be changed from outside the module.

To add data to the rows when the module is called, the module could have arguments passed when invoked.

The same way it's possible to add images, header, subheader and similar. An overview can be found at Extension:Capiunto/Infobox. This makes it possible to use templates with arguments and thereby define a style, change that style and add data as needed.

Using the Infobox module
To use the Infobox modul, you have to go to the page where you want to use the module and depending on whether you have parameters, that you give the module invoke it this way;