Module:Message box/doc

From Convention Master Documentation
Revision as of 09:50, 23 October 2022 by Documentation>WOSlinker (Undo revision 5552071 by WOSlinker (talk))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This is the documentation page for Module:Message box

{{#ifeq:doc|doc||{{#switch:<translate></translate> | = {{#if:{{#ifexpr: ( {{#ifeq:doc|doc|1|0}} or ( {{#ifeq:{{#titleparts:module:message box/doc|-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
                  | [[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:<translate></translate> | =

{{#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

<translate> This is a meta-module that implements the message box templates <tvar name=1>Lua error: Cannot create process: proc_open(/dev/null): Failed to open stream: Operation not permitted</tvar>.</translate> <translate> It is intended to be used from Lua modules, and should not be used directly from wiki pages.</translate> <translate> If you want to use this module's functionality from a wiki page, please use the individual message box templates instead.</translate>

<translate>

Usage

To use this module from another Lua module, first you need to load it. </translate>

local messageBox = require('Module:Message box')

<translate> To create a message box, use the <tvar name=1>main</tvar> function.</translate> <translate> It takes two parameters:</translate>

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,
	-- <translate nowrap><!--T:10--> More parameters...</translate>
})

<translate> There are seven available box types: </translate>

<translate> Box type</translate> <translate> Template</translate> <translate> Purpose</translate>
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:||...}}}}

<translate> For message boxes to be used in multiple namespaces</translate>
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:||...}}}}

<translate> For article message boxes</translate>
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:||...}}}}

<translate> For category message boxes</translate>
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:||...}}}}

<translate> For interface message boxes</translate>
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:||...}}}}

<translate> For file namespace message boxes</translate>
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:||...}}}}

<translate> For talk page message boxes</translate>
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:||...}}}}

<translate> For message boxes in other namespaces</translate>

<translate> See the template page of each box type for the available parameters.

Usage from <tvar name=1>#invoke</tvar>

</translate>

<translate> As well as the <tvar name=1>main</tvar> function, this module has separate functions for each box type.</translate> <translate> They are accessed using the code <tvar name=1>{{#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:

  1. |#|.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. |#|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}}>}}</tvar>, <tvar name=2><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}}} | }}}}</tvar>, etc.</translate> <translate> These will work when called from other modules, but they access code used to process arguments passed from <tvar name=1><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}}} | }}}}</tvar>, and so calling them will be less efficient than calling <tvar name=2>main</tvar></translate>.

<translate>

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 <tvar name=1>Module:Message box/configuration</tvar>. </translate>


[[Category:Module documentation pages{{#translation:}}]]

| #default=

 Lua error: Cannot create process: proc_open(/dev/null): Failed to open stream: Operation not permitted

}}