32,512
edits
m (1 revision imported) |
m (1 revision imported from wikipedia:Module:Message_box/doc: w) |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 1:
{{Used in system}}
{{module rating|p}}
{{Lua|Module:Message box/configuration|Module:Yesno|Module:Arguments|Module:Category handler}}
{{Uses TemplateStyles|Module:Message box/ambox.css|Module:Message box/cmbox.css|Module:Message box/fmbox.css|Module:Message box/imbox.css|Module:Message box/ombox.css|Module:Message box/tmbox.css}}
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.
Line 8 ⟶ 10:
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 20 ⟶ 22:
-- More parameters...
})
</syntaxhighlight>
There are seven available box types:
Line 52 ⟶ 54:
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> – whether empty image cells should be styled.
▲* <code>imageEmptyCell</code> - whether to use an empty {{tag|td}} cell if there is no image set. This is used to preserve spacing for message boxes with a width of less than 100% of the screen.
* <code>
* <code>
* <code>
* <code>
* <code>
* <code>sectionDefault</code>
* <code>allowMainspaceCategories</code> – allow categorisation in the main namespace.
▲* <code>sectionDefault</code> - the default name for the "section" parameter. Depends on <code>useCollapsibleTextFields</code>.
* <code>
* <code>
* <code>
* <code>
|