Module:Infobox/doc: Difference between revisions
Getting rid of examples with "examine" that doesn't appear in this game.
No edit summary |
Thingummywut (talk | contribs) (Getting rid of examples with "examine" that doesn't appear in this game.) |
||
(4 intermediate revisions by one other 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 32 ⟶ 33:
parse.name,
parse.image,
{name = '
parse.episode,
...
Line 49 ⟶ 50:
infobox
:add_row{
{tag='th', content=Infobox.param('name'), class='infobox
}
:add_row{
{tag='td', content=Infobox.param('image'), class='infobox-image', colspan='
}
:pad(
:add_row{
{tag='td', content='
{tag='td', content=Infobox.param('examine')},▼
}
:pad("20")
:add_row{
{tag='
{tag='td', content=Infobox.param('
}
:add_row{
{tag='th', content='[[Episode]]', colspan="6"},
}
...
Line 76 ⟶ 81:
==Functions==
=== Special params ===▼
You don't need to do anything about these special parameters, but they may be used as parameters within the Template:
{| class="wikitable"▼
! param▼
! explanation▼
|-▼
| version1, version2, version3▼
| Button label and SMW name for each switch version of the infobox▼
|-▼
| default_version▼
| The default version to display when the page is loaded▼
|-▼
| version▼
| If there is only a single version, you can use version to set the SMW name (default SMW name is "DEFAULT")▼
|}▼
=== Referring to params ===
Each parameter can have a different value for each version. In addition, there are 3 different representations of each value. Therefore, a parameter must be accessed via one of the 3 helper functions:
Line 94 ⟶ 115:
| 1000
| Value formatted to be saved as an SMW property
▲|}
▲=== Special params ===
▲{| class="wikitable"
▲! param
▲! explanation
▲|-
▲| version1, version2, version3
▲| Button label and SMW name for each switch version of the infobox
▲|-
▲| default_version
▲| The default version to display when the page is loaded
▲|-
▲| version
▲| If there is only a single version, you can use version to set the SMW name (default SMW name is "DEFAULT")
|}
Line 118 ⟶ 123:
</syntaxhighlight>
==== config ====
There are only
<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 274 ⟶ 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".
|