Module:Message box/doc: Difference between revisions
From The Kodiak Republic Wiki
m
84 revisions imported from dev:Module:Message_box/doc
m (Undid revision 902830274 by 174.253.4.251 (talk)) |
m (84 revisions imported from dev:Module:Message_box/doc) |
||
(38 intermediate revisions by 25 users not shown) | |||
Line 1:
This is a meta-module that implements the message box templates {{tl|mbox}}
▲This is a meta-module that implements the message box templates {{tl|mbox}}, {{tl|ambox}}, {{tl|cmbox}}, {{tl|fmbox}}, {{tl|imbox}}, {{tl|ombox}}, and {{tl|tmbox}}. It is intended to be used from Lua modules, and should not be used directly from wiki pages. If you want to use this module's functionality from a wiki page, please use the individual message box templates instead.
== Usage ==
Line 9 ⟶ 5:
To use this module from another Lua module, first you need to load it.
<
local messageBox = require('Module:Message box')
</syntaxhighlight>
To create a message box, use the <code>main</code> function. It takes two parameters: the first is the box type (as a string), and the second is a table containing the message box parameters.
<
local box = messageBox.main( boxType, {
param1 = param1,
Line 21 ⟶ 17:
-- More parameters...
})
</syntaxhighlight>
There are seven available box types:
Line 28 ⟶ 24:
! Box type !! Template !! Purpose
|-
| <code>mbox</code>
|-
| <code>ambox</code>
|-
| <code>cmbox</code>
|-
| <code>fmbox</code>
|-
| <code>imbox</code>
|-
| <code>tmbox</code>
|-
| <code>ombox</code>
|}
See
== Usage from #invoke ==
Line 53 ⟶ 49:
The module uses the same basic code for each of the templates listed above; the differences between each of them are configured using the data at [[Module:Message box/configuration]]. Here are the various configuration options and what they mean:
* <code>types</code>
* <code>default</code>
* <code>showInvalidTypeError</code>
* <code>allowBlankParams</code>
* <code>allowSmall</code>
* <code>smallParam</code>
* <code>smallClass</code>
* <code>substCheck</code>
* <code>classes</code>
* <code>imageEmptyCell</code>
* <code>imageEmptyCellStyle</code>
* <code>imageCheckBlank</code>
* <code>imageSmallSize</code>
* <code>imageCellDiv</code>
* <code>useCollapsibleTextFields</code>
* <code>imageRightNone</code>
* <code>sectionDefault</code>
* <code>allowMainspaceCategories</code>
* <code>templateCategory</code>
* <code>templateCategoryRequireName</code>
* <code>templateErrorCategory</code>
* <code>templateErrorParamsToCheck</code>
|