Content deleted Content added
m Reverted 1 edit by 2A02:C7D:4A8F:D600:91FC:6C0:9A68:60D9 (talk) to last revision by Luis150902. (TW) |
64.114 etc (talk | contribs) No edit summary |
||
(52 intermediate revisions by 36 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 10 ⟶ 11:
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 22 ⟶ 23:
-- More parameters...
})
</syntaxhighlight>
There are seven available box types:
Line 54 ⟶ 55:
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>
<includeonly>{{Sandbox other||
[[Category:Wikipedia modules]]
}}</includeonly>
|