Module:Infobox/doc: Difference between revisions

Document class config
No edit summary
(Document class config)
 
(2 intermediate revisions by the same user not shown)
Line 22:
local config = {
infobox_name = 'Scenery',
class = {Infobox.smw_param('episode')}, -- Add css class with episode name to colorize Infobox
}
</syntaxhighlight>
Line 54 ⟶ 55:
{tag='td', content=Infobox.param('image'), class='infobox-image', colspan='20'},
}
:pad("20")
:add_row{
{tag='td', content='Info', class='infobox-subheader', colspan='20'},
}
:pad("20")
:add_row{
{tag='th', content='Examine', colspan="6"},
Line 122 ⟶ 123:
</syntaxhighlight>
==== config ====
There are only 23 parameters for config
<syntaxhighlight lang="lua">
local config = {
infobox_name = 'Scenery', -- mandatory unique identifier for css
class = {'CustomClass', Infobox.smw_param('episode')} -- optional, defaults to {}. Adds css classes to infobox table: {'infobox-CustomClass', 'infobox-[default version parameter's value]'}
max_buttons = 6, -- optional, defaults to 6, max number of switch buttons before using a dropdown list instead
}
Line 278 ⟶ 280:
infobox:addClass(class)
</syntaxhighlight>
 
 
=== Infobox:dump() ===
Logs all the values into the Debug console for debugging purposes. You can also dump all the values in an Infobox template by setting a template parameter "__dump = Yes".