Template:Mbox/doc: Difference between revisions

From HIBIKIFORUM
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
 
(6 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{Documentation subpage}}
{{Documentation subpage}}
{{Lua|Module:Message box}}
{{Uses TemplateStyles|Template:Mbox/styles.css}}
__NOTOC__
__NOTOC__
{{tl|Mbox}} stands for '''M'''ulti-namespace message'''box''', a [[wikipedia:MTM|metatemplate]] with which [[Wikipedia:Namespace|namespace]]-sensitive messagebox templates can be implemented.
The most common are {{tl|Ambox}} for articles, {{tls|Tmbox}} for talk pages, {{tls|Imbox}} for file (formerly image) pages, {{tl|Cmbox}} for category pages and {{tl|Ombox}} for other types of page.


== Usage ==
== Usage ==
This template should only be used for message boxes that really need to adapt their style. Most message boxes do not need this and should use one of the varieties just listed. Using those templates directly means that your template will look the same on its template page and at any other place you show it, which makes it clear on what kind of pages it is supposed to be used. It also gives you access to any extra features those templates offer, and it saves some server load.
This is a metatemplate to be used to create a varitey of information message box templates. This should only be used in the '''Template''' namespace.
 
This template takes the same parameters as {{tl|Ambox}}, {{tls|Imbox}}, etc. Some of the boxes this template calls only handles images of max 52px width, thus that limitation also applies to this template or you will get ugly padding problems.


== Parameters ==
The image used should never be larger than 45px {{x}} 45px (which is the default size).
List of all parameters:


{{tj|Mbox
{{tj|Mbox
   | demospace: {{{demospace|}}} / main / talk / file / category / other
   | small:
   | type : speedy / delete / content / style / notice / move / protection
   | color:
   | image: none / {{!(n(}}File:Some image.png{{!}}40px]]
   | style:
   | imageright: {{!(n(}}File:Some image.png{{!}}40px]]
   | image:
  | style: CSS values
   | width:
   | textstyle : CSS values
   | header:
   | text : The message body text.
   | content:
   | small: <nowiki>{{{small|}}}</nowiki> / left / yes
  | smallimage: none / {{!(n(}}Image:Some image.png{{!}}30px]]
  | smallimageright: none / {{!(n(}}Image:Some image.png{{!}}30px]]
  | smalltext: A shorter message body text.
}}
}}
</pre>


Note: The small parameters only have effect when the template is on an article, talk page or an "other" page. For documentation on the small parameters see {{tl|ambox}}, {{tls|tmbox}} and {{tl|ombox}}. Using the small parameters when they are not valid has no effect, but also does no harm.
== Parameters ==
 
{| class="wikitable"
== About demospace ==
This template optionally takes the "demospace" parameter as described at {{tl|Namespace detect}}. That parameter is only for testing and demonstration purposes. If you want to lock your message box to one style then instead use one of the other mboxes directly.
 
Namespace "Image:" was renamed to "File:" on 11 December 2008. This template was updated to understand both names well before that, thus it still works fine. For backwards compatibility it still understands "demospace&nbsp;= image" which means the same thing as "demospace&nbsp;= file". But using "demospace&nbsp;= image" is now deprecated.
 
== Message boxes ==
{| class = "wikitable"
! Template !! Description
|-
|-
| {{tl|Ambox}} || Article message box, identifies problems or issues with the article
! style="width: 10%"|Parameter !! Description !! Examples
|-
|-
| {{tl|Cmbox}} || Category message box, {{tl|ambox}} for categories
| {{para|small}} || To use a small box || {{para|small|yes}}
|-
|-
| {{tls|Imbox}} || Image message box, {{tl|ambox}} for file (image) pages
| {{para|color}} || To change the color of the side bar || #85CBD9
|-
|-
| {{tl|Ombox}} || Other pages message box, {{tl|ambox}} for pages of the types User, Wikipedia, MediaWiki, Template, Help, Portal and any new future namespaces
| {{para|style}} || To alter the CSS style of the table || {{para|style|background-color:#DC1F16}}
|-
|-
| {{tls|Tmbox}} || Talk page message box, {{tl|ambox}} for talk pages
| {{para|image}} || A image file to be displayed on the left. Please try to always include an image. || {{para|image|Light bulb.png}}
|-
|-
! colspan = 2 | The following templates are not called by Mbox
| {{para|width}} || The width of the image. || {{para|width|20}}
|-
|-
| {{tls|Dmbox}} || Disambiguation footer message box, used for "disambiguation" and "set index" articles
| {{para|header}} || Title of the information || {{para|header|Current}}
|-
|-
| {{tls|Fmbox}} || used in system messages
| {{para|content}} || The information to be presented || {{para|content|This is a recently released CD so all the information here is subject to change or might be missing. All information should be verified before removing this banner.}}
|}
|}
Note: The small parameter should only be used when the message box is to be used in the section of an article page.
== Currently Used Message Boxes ==
{{Current message boxes}}


== TemplateData ==
== TemplateData ==
<templatedata>
<templatedata>
{
{
    "description": "This is a metatemplate to be used to create a varitey of message box templates.",
"params": {
"params": {
"name": {
"small": {
"label": "Template Name",
"label": "Small Mode",
"description": "The name parameter specifies the name of the template, without the Template namespace prefix. ",
"description": "Creates a small format message box.",
"type": "string"
},
"demospace": {
"label": "Demospace",
"description": "Used for testing and demonstration purposes.",
"type": "string",
"type": "string",
"suggestedvalues": [ "{{{demospace|}}}", "main", "talk", "file", "category", "other" ],
"suggestedvalues": [ "yes" ],
"required": false
"required": false
},
},
"small": {
"color": {
"label": "Small Mode",
"label": "Bar Color",
"description": "The small parameter should be passed through the template, as this will allow editors to use the small format by specifying |small=left on an article.",
"description": "The color of the side bar.",
"type": "string",
"type": "string",
"suggestedvalues": [ "no", "left" ]
"suggested": true,
            "aliases": [ "Color" ],
"suggestedvalues": [ "#DC1F16", "#C0CE73", "pink", "green" ]
},
},
"type": {
"style": {
"label": "Type",
"label": "CSS Style",
"description": "The type of box.",
"description": "Allows for the altering of the table CSS.",
"type": "string",
"type": "string",
"suggestedvalues": [ "speedy", "delete", "content", "style", "notice", "move", "protection" ],
"example": "background-color: orange;",
"required": true
"required": false
},
},
"image": {
"image": {
Line 91: Line 74:
"description": "You can choose a specific image instead of the default.",
"description": "You can choose a specific image instead of the default.",
"type": "string",
"type": "string",
"example": "[[File:Some image.png|40px]]",
"suggested": true,
"required": false
"example": "Some image.png"
},
},
"imageright": {
 
"label": "Image Right",
"width": {
"description": "An image on the right side of the message box.",
"label": "Image Width",
"type": "string",
"description": "To specify the width of the image. Must be smaller than 45px",
"example": "[[File:Some image.png|40px]]",
"type": "number",
"example": "40",
"required": false
"required": false
},
},
"smallimage": {
"header": {
"label": "Small Image",
"label": "Title",
"description": "Images for the small format box.",
"description": "Title of the information.",
"type": "string",
"type": "string",
"example": "[[File:Some image.png|40px]]",
"required": true
"required": false
},
},
"smallimageright": {
"content": {
"label": "Small Image Right",
"label": "Content",
"description": "Images for the small format box.",
"description": "The information to be presented.",
"type": "string",
"type": "string",
"example": "[[File:Some image.png|40px]]",
"required": true
"required": false
},
"style": {
"label": "Style",
"description": "Optional CSS values may be defined, without quotation marks but with the ending semicolons.",
"type": "string",
"required": false
},
"textstyle": {
"label": "Text Style",
"description": "Optional CSS values may be defined, without quotation marks but with the ending semicolons.",
"type": "string",
"required": false
},
"text": {
"label": "Text",
"description": "May be used instead of Issue and Fix.",
"type": "string",
"suggested": true,
"required": false
},
"smalltext": {
"label": "Small Text",
"description": "Defines Customised text for the small format.",
"type": "string",
"required": false
}
}
}
}
Line 148: Line 105:


<!-- Categories below this line, please -->
<!-- Categories below this line, please -->
[[Category:Templates]]
[[Category:Utility templates]]
}}}}</includeonly>
}}}}</includeonly>

Latest revision as of 01:48, 20 August 2023

Light bulb.png }}
It contains usage information, categories and other content that is not part of the original template page.


Usage

This is a metatemplate to be used to create a varitey of information message box templates. This should only be used in the Template namespace.

The image used should never be larger than 45px × 45px (which is the default size).

{{Mbox
| small =
| color =
| style =
| image =
| width =
| header =
| content =
}}

Parameters

Parameter Description Examples
|small= To use a small box |small=yes
|color= To change the color of the side bar #85CBD9
|style= To alter the CSS style of the table |style=background-color:#DC1F16
|image= A image file to be displayed on the left. Please try to always include an image. |image=Light bulb.png
|width= The width of the image. |width=20
|header= Title of the information |header=Current
|content= The information to be presented |content=This is a recently released CD so all the information here is subject to change or might be missing. All information should be verified before removing this banner.

Note: The small parameter should only be used when the message box is to be used in the section of an article page.

Currently Used Message Boxes

Template Call Usage Where to Put It
{{BLCD current}} Newly released BLCD pages Top of the page
{{BLCD future}} Coming soon BLCD pages Top of the page
{{Drama current}} Newly released Drama CD pages Top of the page
{{Drama future}} Coming soon Drama CD pages Top of the page
{{R18 current}} Newly released R18 CD pages Top of the page
{{R18 future}} Coming soon R18 CD pages Top of the page
{{Notice}} For delivering important information Top of the page
{{Delete}} To mark a page for deletion Top of the page
{{Section delete}} To notify when a section header should be deleted Under the section header
{{Cleanup}} To mark a page for cleanup Top of the page
{{Stub}} To mark a page that needs expanding Top of the page
{{Section}} To mark a section that needs expanding Under the section header
{{Archived}} To mark a page to be archived Top of the page

TemplateData

This is a metatemplate to be used to create a varitey of message box templates.

Template parameters

ParameterDescriptionTypeStatus
Small Modesmall

Creates a small format message box.

Suggested values
yes
Stringoptional
Bar Colorcolor Color

The color of the side bar.

Suggested values
#DC1F16 #C0CE73 pink green
Stringsuggested
CSS Stylestyle

Allows for the altering of the table CSS.

Example
background-color: orange;
Stringoptional
Imageimage

You can choose a specific image instead of the default.

Example
Some image.png
Stringsuggested
Image Widthwidth

To specify the width of the image. Must be smaller than 45px

Example
40
Numberoptional
Titleheader

Title of the information.

Stringrequired
Contentcontent

The information to be presented.

Stringrequired