މޮޑިއުލް:Message box/doc: Difference between revisions

Content deleted Content added
Created page with "{{High-risk|4,450,000+}} {{module rating|p}} This is a meta-module that implements the message box templates {{tl|mbox}}, {{tl|ambox}}, {{tl|cmbox}}, {{tl|fmbox}}, {{tl|imbox..."
 
m Bot: Replace deprecated <source> tag and "enclose" parameter; cosmetic changes
 
ފޮޅުވަތް 8:
To use this module from another Lua module, first you need to load it.
 
<sourcesyntaxhighlight lang="lua">
local messageBox = require('Module:Message box')
</syntaxhighlight>
</source>
 
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.
 
<sourcesyntaxhighlight lang="lua">
local box = messageBox.main( boxType, {
param1 = param1,
ފޮޅުވަތް 20:
-- More parameters...
})
</syntaxhighlight>
</source>
 
There are seven available box types:
ފޮޅުވަތް 50:
== Technical details ==
 
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> - a table containing data used by the type parameter of the message box. The table keys are the values that can be passed to the type parameter, and the table values are tables containing the class and the image used by that type.