Module:Message box/doc/en
{{#ifeq:en|doc||{{#switch:<translate></translate> | = {{#if:{{#ifexpr: ( {{#ifeq:en|doc|1|0}} or ( {{#ifeq:{{#titleparts:module:message box/doc/en|-1|-2}}|doc|1|0}} and {{#if:{{#translation:}}|1|0}} ) )|1|}}
|
{{#ifeq:show |show
| Lua error: Cannot create process: proc_open(/dev/null): Failed to open stream: Operation not permitted
}}{{#if: |
| {{#ifexist:Module:Message box/doc
| [[Category:{{#switch:Module
| Template | Project = Template
| Module = Module
| User = User
| #default = MediaWiki
}} documentation pages{{#translation:}}]]
| [[Category:Documentation subpages without corresponding pages{{#translation:}}]]
}}
}}
|
}}
| #default=
Lua error: Cannot create process: proc_open(/dev/null): Failed to open stream: Operation not permitted
}}}}<languages />{{#switch: | =
{{#switch:<translate></translate> | = Lua error: Cannot create process: proc_open(/dev/null): Failed to open stream: Operation not permitted | #default=
Lua error: Cannot create process: proc_open(/dev/null): Failed to open stream: Operation not permitted
}} {{#switch:
{{#if:
|
| {{#ifeq:Module|Module
| module
| other
}}
}}
| module = Lua error: Cannot create process: proc_open(/dev/null): Failed to open stream: Operation not permitted | other | #default = Template:Error }} {{#switch:
{{#if:
|
| {{#ifeq:Module|Module
| module
| other
}}
}}
| module = Lua error: Cannot create process: proc_open(/dev/null): Failed to open stream: Operation not permitted | other | #default = Template:Error }} Lua error: Cannot create process: proc_open(/dev/null): Failed to open stream: Operation not permitted Lua error: Cannot create process: proc_open(/dev/null): Failed to open stream: Operation not permitted
This is a meta-module that implements the message box templates Lua error: Cannot create process: proc_open(/dev/null): Failed to open stream: Operation not permitted. 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
To use this module from another Lua module, first you need to load it.
local messageBox = require('Module:Message box')
To create a message box, use the main function.
It takes two parameters:
Lua error: Cannot create process: proc_open(/dev/null): Failed to open stream: Operation not permitted
local box = messageBox.main( boxType, {
param1 = param1,
param2 = param2,
-- More parameters...
})
There are seven available box types:
| Box type | Template | Purpose | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
mbox
|
<templatestyles src="Template:Mono/styles.css"/>{{#if:{{safesubst:#switch: | no | n | false | 0 = | = | ¬ = | yes | y | true | 1 = yes | #default = yes
}}|<templatestyles src="Template:Nowrap/styles.css"/>}}{{[[{{#if:|{{{SISTER}}}Template|Template}}:mbox|mbox]]{{#if:||{{{2}}}}}{{#if:||{{{3}}}}}{{#if:||{{{4}}}}}{{#if:||{{{5}}}}}{{#if:||{{{6}}}}}{{#if:||{{{7}}}}}{{#if:||...}}}} |
For message boxes to be used in multiple namespaces |
ambox
|
<templatestyles src="Template:Mono/styles.css"/>{{#if:{{safesubst:#switch: | no | n | false | 0 = | = | ¬ = | yes | y | true | 1 = yes | #default = yes
}}|<templatestyles src="Template:Nowrap/styles.css"/>}}{{[[{{#if:|{{{SISTER}}}Template|Template}}:ambox|ambox]]{{#if:||{{{2}}}}}{{#if:||{{{3}}}}}{{#if:||{{{4}}}}}{{#if:||{{{5}}}}}{{#if:||{{{6}}}}}{{#if:||{{{7}}}}}{{#if:||...}}}} |
For article message boxes |
cmbox
|
<templatestyles src="Template:Mono/styles.css"/>{{#if:{{safesubst:#switch: | no | n | false | 0 = | = | ¬ = | yes | y | true | 1 = yes | #default = yes
}}|<templatestyles src="Template:Nowrap/styles.css"/>}}{{[[{{#if:|{{{SISTER}}}Template|Template}}:cmbox|cmbox]]{{#if:||{{{2}}}}}{{#if:||{{{3}}}}}{{#if:||{{{4}}}}}{{#if:||{{{5}}}}}{{#if:||{{{6}}}}}{{#if:||{{{7}}}}}{{#if:||...}}}} |
For category message boxes |
fmbox
|
<templatestyles src="Template:Mono/styles.css"/>{{#if:{{safesubst:#switch: | no | n | false | 0 = | = | ¬ = | yes | y | true | 1 = yes | #default = yes
}}|<templatestyles src="Template:Nowrap/styles.css"/>}}{{[[{{#if:|{{{SISTER}}}Template|Template}}:fmbox|fmbox]]{{#if:||{{{2}}}}}{{#if:||{{{3}}}}}{{#if:||{{{4}}}}}{{#if:||{{{5}}}}}{{#if:||{{{6}}}}}{{#if:||{{{7}}}}}{{#if:||...}}}} |
For interface message boxes |
imbox
|
<templatestyles src="Template:Mono/styles.css"/>{{#if:{{safesubst:#switch: | no | n | false | 0 = | = | ¬ = | yes | y | true | 1 = yes | #default = yes
}}|<templatestyles src="Template:Nowrap/styles.css"/>}}{{[[{{#if:|{{{SISTER}}}Template|Template}}:imbox|imbox]]{{#if:||{{{2}}}}}{{#if:||{{{3}}}}}{{#if:||{{{4}}}}}{{#if:||{{{5}}}}}{{#if:||{{{6}}}}}{{#if:||{{{7}}}}}{{#if:||...}}}} |
For file namespace message boxes |
tmbox
|
<templatestyles src="Template:Mono/styles.css"/>{{#if:{{safesubst:#switch: | no | n | false | 0 = | = | ¬ = | yes | y | true | 1 = yes | #default = yes
}}|<templatestyles src="Template:Nowrap/styles.css"/>}}{{[[{{#if:|{{{SISTER}}}Template|Template}}:tmbox|tmbox]]{{#if:||{{{2}}}}}{{#if:||{{{3}}}}}{{#if:||{{{4}}}}}{{#if:||{{{5}}}}}{{#if:||{{{6}}}}}{{#if:||{{{7}}}}}{{#if:||...}}}} |
For talk page message boxes |
ombox
|
<templatestyles src="Template:Mono/styles.css"/>{{#if:{{safesubst:#switch: | no | n | false | 0 = | = | ¬ = | yes | y | true | 1 = yes | #default = yes
}}|<templatestyles src="Template:Nowrap/styles.css"/>}}{{[[{{#if:|{{{SISTER}}}Template|Template}}:ombox|ombox]]{{#if:||{{{2}}}}}{{#if:||{{{3}}}}}{{#if:||{{{4}}}}}{{#if:||{{{5}}}}}{{#if:||{{{6}}}}}{{#if:||{{{7}}}}}{{#if:||...}}}} |
For message boxes in other namespaces |
See the template page of each box type for the available parameters.
Usage from #invoke
As well as the main function, this module has separate functions for each box type.
They are accessed using the code {{#ifexpr:{{safesubst:#switch: 1
|no |n |false |0 = 0 | = 0 |¬ = |yes |y |true |1 = 1 |#default = 1
}}or{{safesubst:#switch:
|no |n |false |0 = 0 | = 0 |¬ = |yes |y |true |1 = 1 |#default = 1
}}or{{safesubst:#switch: 1
|no |n |false |0 = 0 | = 0 |¬ = |yes |y |true |1 = 1 |#default = 1
}}|{{#if:{{safesubst:#switch:
|no |n |false |0 = | = |¬ = |yes |y |true |1 = yes |#default = yes
}}|<templatestyles src="Template:Mono/styles.css"/>}}{{#if:{{safesubst:#switch: 1
|no |n |false |0 = | = |¬ = |yes |y |true |1 = yes |#default = yes
}}|<templatestyles src="Template:Nowrap/styles.css"/>}}<{{#if:{{safesubst:#switch: 1
|no |n |false |0 = | = |¬ = |yes |y |true |1 = yes |#default = yes
}}|code|span}} {{#ifexpr:{{safesubst:#switch:
|no |n |false |0 = 0 | = 0 |¬ = |yes |y |true |1 = 1 |#default = 1
}}or{{safesubst:#switch: 1
|no |n |false |0 = 0 | = 0 |¬ = |yes |y |true |1 = 1 |#default = 1
}}|class="{{safesubst:#switch:
|no |n |false |0 = | = |¬ = |yes |y |true |1 = monospaced |#default = monospaced
}} {{safesubst:#switch: 1
|no |n |false |0 = | = |¬ = |yes |y |true |1 = nowrap |#default = nowrap
}}"}}>}}{{[[mw:Special:MyLanguage/{{#switch:Scribunto|Translate=Help:Extension:Translate{{#switch:#invoke|#translation=/Page translation administration}}|ParserFunctions=Help:Extension:ParserFunctions|Page Forms=Extension:Page Forms{{#switch:#invoke|#arraymap|#arraymaptemplate|#template_display|#template_params=/Page Forms and templates|#autoedit|#forminput|#formlink|#formredlink=/Linking to forms|#queryformlink=/Creating query forms|#default_form=/The "edit with form" tab}}|#default=Extension:Scribunto|=Help:Magic words}}#{{#ifeq:
- |#|.23{{safesubst:#ifexpr: 1 < 0
|#invoke |{{safesubst:#ifexpr: 1+1 > Lua error: Cannot create process: proc_open(/dev/null): Failed to open stream: Operation not permitted | | Lua error: Cannot create process: proc_open(/dev/null): Failed to open stream: Operation not permitted }} }}|#invoke}}|#invoke]]{{#ifexpr:{{#ifeq:Message box|mbox|...|Message box|mbox|...|1|0}}or{{#ifeq:
- |#|1|0}}|:Message box|mbox|...}}}}{{#ifexpr:{{safesubst:#switch: 1
|no |n |false |0 = 0 | = 0 |¬ = |yes |y |true |1 = 1 |#default = 1
}}or{{safesubst:#switch:
|no |n |false |0 = 0 | = 0 |¬ = |yes |y |true |1 = 1 |#default = 1
}}or{{safesubst:#switch: 1
|no |n |false |0 = 0 | = 0 |¬ = |yes |y |true |1 = 1 |#default = 1
}}|</{{#if:{{safesubst:#switch: 1
|no |n |false |0 = | = |¬ = |yes |y |true |1 = yes |#default = yes
}}|code|span}}>}}, <templatestyles src="Template:Nowrap/styles.css"/>{{#invoke:Message box{{#ifeq:ambox|ambox| |ambox | }}{{#ifeq:...|...| |... | }}{{#ifeq:x|| |{{{4}}} | }}{{#ifeq:x|| |{{{5}}} | }}{{#ifeq:x|| |{{{6}}} | }}{{#ifeq:x|| |{{{7}}} | }}{{#ifeq:x|| |{{{8}}} | }}{{#ifeq:x|| |{{{9}}} | }}}}, etc.
These will work when called from other modules, but they access code used to process arguments passed from <templatestyles src="Template:Nowrap/styles.css"/>{{#invoke:...{{#ifeq:x|| |{{{2}}} | }}{{#ifeq:x|| |{{{3}}} | }}{{#ifeq:x|| |{{{4}}} | }}{{#ifeq:x|| |{{{5}}} | }}{{#ifeq:x|| |{{{6}}} | }}{{#ifeq:x|| |{{{7}}} | }}{{#ifeq:x|| |{{{8}}} | }}{{#ifeq:x|| |{{{9}}} | }}}}, and so calling them will be less efficient than calling main.
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.
[[Category:Module documentation pages{{#translation:}}]]
| #default=
Lua error: Cannot create process: proc_open(/dev/null): Failed to open stream: Operation not permitted
}}