Template:Ombox/doc: Difference between revisions

From the Croc Wiki, the Croc encyclopedia
Jump to navigationJump to search
m
84 revisions imported
m (Reverted edits by 107.77.208.6 (talk) (HG) (3.1.22))
m (84 revisions imported)
 
(31 intermediate revisions by 20 users not shown)
Line 1:
{{Documentation subpage}}
{{High-risk|430,000+}}
{{used in system}}
{{Lua|Module:Message box}}
{{intricate template}}
<!-- PLEASE ADD CATEGORIES WHERE INDICATED AT THE BOTTOM OF THIS PAGE -->
{{Mbox templates (small)}}
Line 14 ⟶ 12:
 
=== Introduction ===
{{anchor|We are deploying!|Intro}}
As noted above, this template should be used for message boxes that are not articles, talk pages, image pages or category pages. Some message boxes for other pages may incorrectly use one of those four mentioned. Feel free to convert any message boxes used on "other pages" to use this meta-template. If you find any tricky cases then list them on the talk page of this template and you'll get help.
 
Line 23 ⟶ 21:
 
<pre>
{{ombox | text = Some text.}}
| text = Some text.
}}
</pre>
 
Line 34:
{{ombox
| type = style
| image = [[ImageFile:Emblem-question-yellow.svg|40px]]
| style = width: 400px;
| textstyle = color: red; font-weight: bold; font-style: italic;
Line 43:
{{ombox
| type = style
| image = [[ImageFile:Emblem-question-yellow.svg|40px]]
| style = width: 400px;
| textstyle = color: red; font-weight: bold; font-style: italic;
Line 63:
{{ombox
| type = content
| text = type=<u>content</u> – Major warnings and problems, such as {{tl|high-riskuse}}.
}}
{{ombox
| type = style
| text = type=<u>style</u> – Minor warnings and problems. {{tl|intricateIntricate template}} should perhaps use this type.
}}
{{ombox
| type = notice
| text = type=<u>notice</u> – Notices and messages of any kind, both permanent and temporary. Such as {{tl|guideline}} and {{tl|Wikipedia how -to}}.
}}
{{ombox
Line 79:
{{ombox
| type = protection
| text = type=<u>protection</u> – Protection templates such as {{tl|pp-protected}} when shown on "other pages".
}}
 
Line 93:
}}
{{ombox
| image = [[ImageFile:Gnome globe current event.svg|42px]]
| imageright = [[ImageFile:Nuvola apps bookcase.svg|40px]]
| text = image = <nowiki>[[ImageFile:Gnome globe current event.svg|42px]]</nowiki> <br> imageright = <nowiki>[[ImageFile:Nuvola apps bookcase.svg|40px]]</nowiki>
}}
 
{{ombox
| type = notice
| image = [[ImageFile:Blue check.svg|30px]]
| imageright = {{shortcut|WP:SHORT}}
| text =
Line 107:
{{ombox
| type = notice
| image = [[ImageFile:Nutshell.png|30px]]
| text =
'''This page in a nutshell:''' This template is used to build message boxes for all pages that are ''not'' articles, talk pages, image pages or category pages.
Line 115:
List of all parameters:
 
<syntaxhighlight lang="moin">
<pre>
{{ombox
| name = name of the template
| type = speedy / delete / content / style / notice / move / protection
| image = none / [[ImageFile:Some image.svg|40px]]
| imageright = [[ImageFile:Some image.svg|40px]]
| style = CSS values
| textstyle = CSS values
Line 125 ⟶ 126:
| text = The message body text.
| small = {{{small|}}} / yes
| smallimage = none / [[ImageFile:Some image.svg|30px]]
| smallimageright = none / [[ImageFile:Some image.svg|30px]]
| smalltext = A shorter message body text.
}}
</syntaxhighlight>
</pre>
 
'''name'''
:(Optional) Name of the template. This adds a CSS class with name <code>box-''name''</code> to the HTML element, for use by bots or scripts.
 
'''type'''
Line 137 ⟶ 141:
:'''No parameter''' = If no '''image''' parameter is given the template uses a default image. Which default image it uses depends on the '''type''' parameter.
:'''An image''' = Should be an image with usual wiki notation. 40px - 50px width are usually about right depending on the image height to width ratio. (But the message box can handle images of any size.) For example:
::<code><nowiki>image = [[ImageFile:Crystal package settings.png|40px]]</nowiki></code>
:'''none''' = Means that no image is used.
 
Line 143 ⟶ 147:
:'''No parameter''' = If no '''imageright''' parameter is given then no image is shown on the right side.
:'''An image''' = Should be an image with usual wiki notation. 40px - 50px width are usually about right depending on the image height to width ratio. (But the message box can handle images of any size.) For example:
::<code><nowiki>imageright = [[ImageFile:Nuvola apps bookcase.png|40px]]</nowiki></code>
:'''Anything''' = Any other object that you want to show on the right side.
 
Line 176 ⟶ 180:
{{ombox
| small = yes
| image = [[ImageFile:Replacement filing cabinet.svg|50px]]
| smallimage = [[ImageFile:Replacement filing cabinet.svg|32px]]
| text =
small = yes <br> image = <nowiki>[[ImageFile:Replacement filing cabinet.svg|50px]]</nowiki> <br> smallimage = <nowiki>[[ImageFile:Replacement filing cabinet.svg|32px]]</nowiki>
}}
'''smallimage'''
:'''No parameter''' = If no '''smallimage''' parameter is given then this template falls back to use the '''image''' parameter. If the '''image''' parameter also is empty then a small default image is used.
:'''An image''' = Should be an image with usual wiki notation. 30px width is usually about right. For example:
::<code><nowiki>smallimage = [[ImageFile:Replacement filing cabinet.svg|30px]]</nowiki></code>
:'''none''' = Means that no image is used. This overrides any image fed to '''image''', when "small=yes".
 
{{ombox
| small = yes
| imageright = [[ImageFile:Nuvola apps bookcase.png|50px]]
| smallimageright = none
| text =
small = yes <br> imageright = <nowiki>[[ImageFile:Nuvola apps bookcase.png|50px]]</nowiki> <br> smallimageright = none
}}
'''smallimageright'''
:'''No parameter''' = If no '''smallimageright''' parameter is given then this template falls back to use the '''imageright''' parameter. If the '''imageright''' parameter also is empty then no image is shown on the right side.
:'''An image''' = Should be an image with usual wiki notation. 30px width is usually about right. For example:
::<code><nowiki>smallimageright = [[ImageFile:Nuvola apps bookcase.png|30px]]</nowiki></code>
:'''Anything''' = Any other object that you want to show on the right side.
:'''none''' = Means that no right side image is used. This overrides any image fed to '''imageright''', when "small=yes".
Line 207 ⟶ 211:
If you need to use special characters in the text parameter then you need to escape them like this:
 
<syntaxhighlight lang="tid">
<pre>
{{ombox
| text = <div>
Equal sign = and a start and end brace { } work fine as they are.
But here is a pipe {{!}} and two end braces &lt;<nowiki>}}&lt;</nowiki>.
And now a pipe and end braces &lt;<nowiki>|}}&lt;</nowiki>.
</div>
}}
</syntaxhighlight>
</pre>
 
{{ombox
Line 225 ⟶ 229:
}}
 
This template uses the ombox CSS classes in [[MediaWiki:Common.css]] for most of its looks, thus it is fully skinnable.
 
This template calls {{tl|ombox/core}} which holds most of the code for {{tl|ombox}}, while {{tl|ombox}} itself does parameter preprocessing.
 
Internally this meta-template uses HTML markup instead of wiki markup for the table code. That is the usual way we make meta-templates since wiki markup has several drawbacks. For instance it makes it harder to use [[m:Help:ParserFunctions|parser functions]] and special characters in parameters.
 
The default images for this meta-template are in png format instead of svg format. The main reason is that some older web browsers have trouble with the transparent background that MediaWiki renders for svg images. The png images here have hand optimised transparent background colour so they look good in all browsers. Note that svg icons only look somewhat bad in the old browsers, thus such hand optimisation is only worth the trouble for very widely used icons.
Line 238:
{{Mbox templates see also}}
 
<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandboxSandbox other|
| <!-- CATEGORIES BELOW THIS LINE, PLEASE: -->
[[Category:Mbox and messagebox templates]]
Cookies help us deliver our services. By using our services, you agree to our use of cookies.

Navigation menu