Jump to content
Toggle menu
  • 8 articles
  • 75 files
  • 7 users
  • 37.8K edits
Neodyland Wiki
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Template:Mbox/doc: Difference between revisions

Template page
new section {{int:Seealso}}
templatedata; – cmbox (soon to be deprecated); – cleanupbox (also kind of deprecated, only difference is langlink (deprecated) support, therefore potentially confusing to users)
Line 6: Line 6:
  |1type    = string/line
  |1type    = string/line
  |1def    = <!-- default value for the parameter -->
  |1def    = <!-- default value for the parameter -->
  |1stat    = <!-- required, optional or optional-; optional- means it is optional and omitted in the usage-sample -->
  |1stat    = required


  |2        = type
  |2        = type
Line 14: Line 14:
  |2type    = string
  |2type    = string
  |2def    = notice
  |2def    = notice
  |2stat    = <!-- required, optional or optional-; optional- means it is optional and omitted in the usage-sample -->
  |2stat    = optional


  |3        = image
  |3        = image
Line 22: Line 22:
  |3aliases = <!-- List of aliases, separated by / (a slash) -->
  |3aliases = <!-- List of aliases, separated by / (a slash) -->
  |3type    = string/wiki-page-name
  |3type    = string/wiki-page-name
  |3def    = depend on style
  |3def    = depends on style
  |3stat    = <!-- required, optional or optional-; optional- means it is optional and omitted in the usage-sample -->
  |3stat    = optional


  |4        = imageright
  |4        = imageright
Line 31: Line 31:
  |4type    = string/wiki-page-name
  |4type    = string/wiki-page-name
  |4def    = <!-- default value for the parameter -->
  |4def    = <!-- default value for the parameter -->
  |4stat    = <!-- required, optional or optional-; optional- means it is optional and omitted in the usage-sample -->
  |4stat    = optional
  -
  -
  |5        = textstyle
  |5        = textstyle
Line 38: Line 38:
  |5aliases = <!-- List of aliases, separated by / (a slash) -->
  |5aliases = <!-- List of aliases, separated by / (a slash) -->
  |5type    = string
  |5type    = string
|5def    = <!-- default value for the parameter -->
  |5stat    = optional-
  |5stat    = <!-- required, optional or optional-; optional- means it is optional and omitted in the usage-sample -->


  |6        = style
  |6        = style
Line 46: Line 45:
  |6aliases = <!-- List of aliases, separated by / (a slash) -->
  |6aliases = <!-- List of aliases, separated by / (a slash) -->
  |6type    = string
  |6type    = string
|6def    = <!-- default value for the parameter -->
  |6stat    = optional-
  |6stat    = <!-- required, optional or optional-; optional- means it is optional and omitted in the usage-sample -->


  |7        = lang
  |7        = lang
Line 54: Line 52:
  |7aliases = <!-- List of aliases, separated by / (a slash) -->
  |7aliases = <!-- List of aliases, separated by / (a slash) -->
  |7type    = string
  |7type    = string
|7def    = <!-- default value for the parameter -->
  |7stat    = optional-
  |7stat    = optional-


Line 134: Line 131:
|type=
|type=
}}
}}
=={{int:Seealso}}==
* {{tl|cmbox}} – use for '''''categories''''' instead (the style is different).
* {{tl|cleanupbox}} – use for ''files'' (is based on this, mainly for template layout)


<includeonly>
<includeonly>

Revision as of 19:34, 13 June 2015

This is used to create message boxes.

Usage

{{Mbox
 |text =
 |type =
 |image =
 |imageright =
}}

Template parameters

ParameterDescriptionDefaultStatus
textThe text to be displayed.emptyrequired
typeChanges the color depending on the message needed. Each has its own preset image.noticeoptional
imageOverride the image (none for no image).depends on styleoptional
imagerightShow an image on the right side.emptyoptional
textstyleOverride default style of text (e.g. alignment - text-align:left; / text-align:right; / text-align:center;).emptyoptional
styleOverride in custom style overrides for the template using CSS.emptyoptional
langSet the language of the text – it's important for right-to-left languages: their image is on the right and imageright is on the left.emptyoptional
<templatedata>JSON</templatedata> ./. {{TemplateBox}}
TemplateData

TemplateData is a way to store information about template parameters (the description of those and of the whole template) for both humans and machines. It is used by VisualEditor and possibly other tools like Upload Wizard.


Existing template documentation
At Wikimedia Commons, it is recommended to use {{TemplateBox}} with either ‎useTemplateData=1 or ‎useTemplateData=only on the ‎/doc subpage and transcluding it with {{Documentation}} into the template. ‎<nowiki>-tags can be wrapped around the arguments, if required, to avoid templates being expanded.

Newly created template documentation and imports
Another option, especially for imported templates, or for users with JSON experience, is placing raw ‎<templatedata>-tags into the Wikitext of the template, as described in various Wikipediae.


Wikipedia's help about TemplateDataCommons-specific information

This is used to create message boxes.

Template parameters

This template prefers block formatting of parameters.

ParameterDescriptionTypeStatus
image

Override the image (none for no image).

Default
depends on style
Page nameoptional
imageright

Show an image on the right side.

Page nameoptional
lang

Set the language of the text – it's important for right-to-left languages: their image is on the right and imageright is on the left.

Stringoptional
style

Override in custom style overrides for the template using CSS.

Stringoptional
text

The text to be displayed.

Linerequired
textstyle

Override default style of text (e.g. alignment - text-align:left; / text-align:right; / text-align:center;).

Stringoptional
type

Changes the color depending on the message needed. Each has its own preset image.

Default
notice
Stringoptional

Additional information

The template is intended to be used in the following namespaces: all namespaces

The template is intended to be used by the following user groups: all users

Localization

This template is not intended to be localized.

Examples


Cookies help us deliver our services. By using our services, you agree to our use of cookies.