Difference between revisions of "Template:Mbox"
From James Dooley's Wiki
| (21 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
| − | <div {{# | + | <div style="padding: 0 25px 0 25px; border: ridge 5px; {{#switch: {{{type|}}} |
| − | <table style=" | + | | warning = border-color: red; background: rgba(255,0,0,.2); |
| − | <tr><td style="width: 60px; height: 60px;"> | + | | caution = border-color: yellow; background: rgba(255,255,128,.4); |
| − | [[File:{{#if: {{{image|}}} | + | | info = border-color: blue; background: rgba(0,0,255,.1); |
| − | |{{{image|}}} | + | | step = border-color: green; background: rgba(0,255,0,.1); |
| − | | {{#switch: {{{type|}}} | + | | centos = border-color: gold; background: rgba(255,215,0,.1); |
| − | + | | ubuntu = border-color: #DD4814; background: rgba(221,72,20,.1); | |
| − | + | }} {{{style|}}}"> | |
| − | + | <table style="position: relative; left: -20px; background:none;"> | |
| − | + | <tr>{{#switch: {{{image|}}} | |
| − | + | |none=<td> | |
| − | + | |#default=<td style="{{#switch: {{{size|}}} | |
| − | }} | + | | normal |
| − | }} | + | | small=width: 40px; height: 40px; |
| − | </td><td style="text-align: left; vertical-align: | + | | tiny=width: 20px; height: 20px; |
| + | | #default=width: 60px; height: 60px;}}">[[File:{{#if: {{{image|}}} | ||
| + | |{{{image|}}} | ||
| + | | {{#switch: {{{type|}}} | ||
| + | | warning = warning_icon.png | ||
| + | | caution = caution_icon.png | ||
| + | | step = step_icon.png | ||
| + | | centos = centos_icon.png | ||
| + | | ubuntu = ubuntu_icon.png | ||
| + | | info | ||
| + | | #default = info_icon.png | ||
| + | }} | ||
| + | }}|{{#switch: {{{size|}}} | ||
| + | | normal | ||
| + | | small=30px | ||
| + | | tiny=20px | ||
| + | | #default=60px}}|center|{{{caption|}}}]]{{#if: {{{version|}}}| <div style="text-align: center; {{#switch:{{{size|}}} | ||
| + | | normal | ||
| + | | small=font-size: 20px; | ||
| + | | tiny= | ||
| + | | #default=font-size: 30px; }} background-color: rgba(128,128,128,.7);">{{{version}}}</div>|}}{{{caption|}}} | ||
| + | }} | ||
| + | </td><td style="text-align: left; vertical-align: center; {{#switch:{{{size|}}} | ||
| + | | normal | ||
| + | | small=font-size: 20px; | ||
| + | | tiny= | ||
| + | | #default=font-size: 30px; }}">{{{msg|}}}</td></tr> | ||
</table> | </table> | ||
{{{text|}}} | {{{text|}}} | ||
</div> | </div> | ||
| + | <noinclude> | ||
| + | == Usage == | ||
| + | General usage layout is: | ||
| + | <pre> | ||
| + | {{mbox | ||
| + | |type= [warning|caution|info|step|centos|ubuntu] | ||
| + | |msg= Text in this area will be used for a title message, font size is 20px | ||
| + | |text= Text in this area will be treated like normal wiki text (MOST normal formatting should work but will be contained inside the border, note <nowiki>|</nowiki> may not work properly). | ||
| + | This also allows for multiple lines. | ||
| + | |image= [image file name| none] | ||
| + | |caption= This will provide a small area for an image caption. | ||
| + | |version= Useful if you are specifying a specific version of an operating system, will display below the icon. | ||
| + | |style= Additional style information after the defaults are set. This should allow you to override the default settings. | ||
| + | |size= [normal|small|tiny] | ||
| + | }} | ||
| + | </pre> | ||
| + | |||
| + | ==Example== | ||
| + | <pre> | ||
| + | {{mbox | ||
| + | |type=caution | ||
| + | |image=Centos_icon.png | ||
| + | |msg=Caution Message | ||
| + | |text=More information about the message | ||
| + | example formatting | ||
| + | |caption=CentOS5 | ||
| + | |version=5.x | ||
| + | |style=border: 4px dotted green | ||
| + | }} | ||
| + | </pre> | ||
| + | {{mbox | ||
| + | |type=caution | ||
| + | |image=Centos_icon.png | ||
| + | |msg=Caution Message | ||
| + | |text=More information about the message | ||
| + | example formatting | ||
| + | |caption=CentOS5 | ||
| + | |version=5.x | ||
| + | |style=border: 4px dotted green | ||
| + | }} | ||
| + | |||
| + | ==Pipes in message box== | ||
| + | {{mbox | ||
| + | |type=info | ||
| + | |msg= Pipes '{{!}}' in message boxes | ||
| + | |text= | ||
| + | The template structure automatically will read {{!}}'s as being part of the template and will likely break the rest of the message. | ||
| + | |||
| + | To get around this there are a few things you can do. | ||
| + | |||
| + | * Use the [[template:!]] template if you need the {{!}} to display on the screen. | ||
| + | |||
| + | <pre>{{!}}</pre> | ||
| + | |||
| + | * Use HTML code if you are trying to create a table. | ||
| + | }} | ||
| + | |||
| + | ==Nesting== | ||
| + | {{mbox | ||
| + | |type=step | ||
| + | |msg=The text field will allow for nesting of message boxes | ||
| + | |text= | ||
| + | {{mbox|type=info|size=small|msg=This can make for some interesting message boxes}} | ||
| + | }} | ||
| + | |||
| + | ==Types== | ||
| + | ===Normal=== | ||
| + | {{mbox | ||
| + | |type=warning | ||
| + | |msg=warning | ||
| + | }} | ||
| + | {{mbox | ||
| + | |type=caution | ||
| + | |msg=caution | ||
| + | }} | ||
| + | {{mbox | ||
| + | |type=info | ||
| + | |msg=info | ||
| + | }} | ||
| + | {{mbox | ||
| + | |type=step | ||
| + | |msg=step | ||
| + | }} | ||
| + | {{mbox | ||
| + | |type=centos | ||
| + | |msg=centos | ||
| + | }} | ||
| + | {{mbox | ||
| + | |type=ubuntu | ||
| + | |msg=ubuntu | ||
| + | }} | ||
| + | ===Small=== | ||
| + | {{mbox | ||
| + | |type=warning | ||
| + | |msg=warning | ||
| + | |size=small | ||
| + | }} | ||
| + | {{mbox | ||
| + | |type=caution | ||
| + | |msg=caution | ||
| + | |size=small | ||
| + | }} | ||
| + | {{mbox | ||
| + | |type=info | ||
| + | |msg=info | ||
| + | |size=small | ||
| + | }} | ||
| + | {{mbox | ||
| + | |type=step | ||
| + | |msg=step | ||
| + | |size=small | ||
| + | }} | ||
| + | {{mbox | ||
| + | |type=centos | ||
| + | |msg=centos | ||
| + | |size=small | ||
| + | }} | ||
| + | {{mbox | ||
| + | |type=ubuntu | ||
| + | |msg=ubuntu | ||
| + | |size=small | ||
| + | }} | ||
| + | |||
| + | ===Tiny=== | ||
| + | {{mbox | ||
| + | |type=warning | ||
| + | |msg=warning | ||
| + | |size=tiny | ||
| + | }} | ||
| + | {{mbox | ||
| + | |type=caution | ||
| + | |msg=caution | ||
| + | |size=tiny | ||
| + | }} | ||
| + | {{mbox | ||
| + | |type=info | ||
| + | |msg=info | ||
| + | |size=tiny | ||
| + | }} | ||
| + | {{mbox | ||
| + | |type=step | ||
| + | |msg=step | ||
| + | |size=tiny | ||
| + | }} | ||
| + | {{mbox | ||
| + | |type=centos | ||
| + | |msg=centos | ||
| + | |size=tiny | ||
| + | }} | ||
| + | {{mbox | ||
| + | |type=ubuntu | ||
| + | |msg=ubuntu | ||
| + | |size=tiny | ||
| + | }} | ||
| + | ===No Image=== | ||
| + | {{mbox | ||
| + | |type=warning | ||
| + | |image=none | ||
| + | |msg=warning | ||
| + | }} | ||
| + | {{mbox | ||
| + | |type=warning | ||
| + | |image=none | ||
| + | |msg=warning | ||
| + | |size=small | ||
| + | }} | ||
| + | {{mbox | ||
| + | |type=warning | ||
| + | |image=none | ||
| + | |msg=warning | ||
| + | |size=tiny | ||
| + | }} | ||
| + | </noinclude> | ||
Latest revision as of 20:18, 26 February 2013
Contents
Usage
General usage layout is:
{{mbox
|type= [warning|caution|info|step|centos|ubuntu]
|msg= Text in this area will be used for a title message, font size is 20px
|text= Text in this area will be treated like normal wiki text (MOST normal formatting should work but will be contained inside the border, note | may not work properly).
This also allows for multiple lines.
|image= [image file name| none]
|caption= This will provide a small area for an image caption.
|version= Useful if you are specifying a specific version of an operating system, will display below the icon.
|style= Additional style information after the defaults are set. This should allow you to override the default settings.
|size= [normal|small|tiny]
}}
Example
{{mbox
|type=caution
|image=Centos_icon.png
|msg=Caution Message
|text=More information about the message
example formatting
|caption=CentOS5
|version=5.x
|style=border: 4px dotted green
}}
Pipes in message box
| Pipes '|' in message boxes |
The template structure automatically will read |'s as being part of the template and will likely break the rest of the message.
To get around this there are a few things you can do.
- Use the template:! template if you need the | to display on the screen.
{{!}}
- Use HTML code if you are trying to create a table.
Nesting
| The text field will allow for nesting of message boxes |
Types
Normal
Small
Tiny
No Image
| warning |
| warning |
| warning |