Difference between revisions of "Template:Ambox"

From TTWiki
Jump to navigationJump to search
Line 1: Line 1:
  +
<!--
<includeonly><div style="{{#IF: {{{style|}}} | {{{style}}} | margin: 0px 10% 0px 10%; border: 1px solid #aaa; border-left: 10px solid {{#switch:{{{type|}}}
 
  +
Wiki Ambox code adaptation
  +
  +
--><noinclude>{{Other_languages
  +
|en=Template:Ambox
  +
|ca=Template:Metacaixa d'avís
  +
|cs=
  +
|de=Template:Ambox
  +
|el=
  +
|es=Template:Metaplantilla de avisos
  +
|fi=
  +
|fr=Template:Fenêtre de message
  +
|hr=
  +
|hu=
  +
|it=
  +
|lb=
  +
|nl=
  +
|no=
  +
|pl=
  +
|pt=Template:Ambox
  +
|ru=
  +
|sk=
  +
|sl=
  +
|sr=
  +
|tr=
  +
|vi=
  +
|zh=
  +
|language_page=en
  +
}}</noinclude><includeonly><div style="{{#IF: {{{style|}}} | {{{style}}} | margin: 0px 10% 0px 10%; border: 1px solid #aaa; border-left: 10px solid {{#switch:{{{type|}}}
 
| delete =#b22222;
 
| delete =#b22222;
 
| content =#f28500;
 
| content =#f28500;
Line 31: Line 59:
 
| notice =
 
| notice =
 
| #default = <div style="text-align: center;">This message box is using an invalid "type={{{type|}}}" parameter and needs fixing.</div>[[Category:Wrong syntax]]
 
| #default = <div style="text-align: center;">This message box is using an invalid "type={{{type|}}}" parameter and needs fixing.</div>[[Category:Wrong syntax]]
}}</includeonly>
+
}}</includeonly><noinclude>
  +
  +
==Usage==
  +
Simple usage example:
  +
<pre>
  +
{{ambox | text = Some text.}}
  +
</pre>
  +
{{ambox | text = Some text.}}
  +
  +
OR:
  +
<pre>
  +
{{ambox
  +
| type = content
  +
| text = Warning - Some text.
  +
}}
  +
</pre>
  +
{{ambox | type = content | text = Warning - Some text.}}
  +
  +
== Available List of parameters==
  +
<pre>
  +
{{ambox
  +
| type = delete / content / style / notice / move / protected
  +
| image = Picture.Png / Picture.Png|alt=Picture (if the parameter does not present, default type icon will be supplied)
  +
| text = Text for a big box, for the top of articles.
  +
  +
| style = Different table style. (preferably should not be used)
  +
| text-style = same as the above for text.
  +
</pre>
  +
  +
=== Article message box types ===
  +
  +
The following examples use different '''type''' parameters but use no image parameters thus they use the default images for each type.
  +
  +
  +
{{ambox
  +
| type = delete
  +
| text = type=<u>delete</u> – Deletion issues, such as {{s|delete}}.
  +
}}
  +
{{ambox
  +
| type = content
  +
| text = type=<u>content</u> – Content issues, such as {{s|Warning}}.
  +
}}
  +
{{ambox
  +
| type = style
  +
| text = type=<u>style</u> – Style issues, such as {{s|cleanup}}.
  +
}}
  +
{{ambox
  +
| type = notice
  +
| text = type=<u>notice</u> – Article notices, such as {{s|current}}.
  +
}}
  +
{{ambox
  +
| type = move
  +
| text = type=<u>move</u> – Merge, split and transwiki proposals, such as {{s|split}}.
  +
}}
  +
{{ambox
  +
| type = protected
  +
| text = type=<u>protected</u> – Protection notices, such as {{s|Historical}}.
  +
}}
  +
  +
=== Other images ===
  +
  +
The default images shown above are mostly for convenience. In many cases it is more appropriate to use more specific images. These example use the '''image''' parameter to specify an image other than the default images.
  +
  +
<pre>{{ambox
  +
| type = notice
  +
| image = OpenttdManual.png
  +
| text = Something Something Something
  +
}}</pre>
  +
  +
{{ambox
  +
| type = notice
  +
| image = OpenttdManual.png
  +
| text = Something Something Something
  +
}}
  +
  +
[[Category:Templates|A]][[Category:Message boxes|A]]
  +
</noinclude><!--
  +
  +
CSS if the option will become available
  +
  +
/* Article message box styles */
  +
table.ambox {
  +
margin: 0px 10%; /* 10% = Will not overlap with other elements */
  +
border: 1px solid #aaa;
  +
border-left: 10px solid #1e90ff; /* Default "notice" blue */
  +
background: #fbfbfb;
  +
}
  +
table.ambox + table.ambox { /* Single border between stacked boxes. */
  +
margin-top: -1px;
  +
}
  +
.ambox th.mbox-text,
  +
.ambox td.mbox-text { /* The message body cell(s) */
  +
padding: 0.25em 0.5em; /* 0.5em left/right */
  +
}
  +
.ambox td.mbox-image { /* The left image cell */
  +
padding: 2px 0 2px 0.5em; /* 0.5em left, 0px right */
  +
}
  +
.ambox td.mbox-imageright { /* The right image cell */
  +
padding: 2px 0.5em 2px 0; /* 0px left, 0.5em right */
  +
}
  +
  +
table.ambox-notice {
  +
border-left: 10px solid #1e90ff; /* Blue */
  +
}
  +
table.ambox-speedy {
  +
border-left: 10px solid #b22222; /* Red */
  +
background: #fee; /* Pink */
  +
}
  +
table.ambox-delete {
  +
border-left: 10px solid #b22222; /* Red */
  +
}
  +
table.ambox-content {
  +
border-left: 10px solid #f28500; /* Orange */
  +
}
  +
table.ambox-style {
  +
border-left: 10px solid #f4c430; /* Yellow */
  +
}
  +
table.ambox-move {
  +
border-left: 10px solid #9932cc; /* Purple */
  +
}
  +
table.ambox-protection {
  +
border-left: 10px solid #bba; /* Gray-gold */
  +
}
  +
-->

Revision as of 19:01, 22 March 2015

Template:Other languages

Usage

Simple usage example:

{{ambox | text = Some text.}}
Notice.png

Some text.

OR:

{{ambox 
| type = content
| text = Warning - Some text.
}}
Content.png

Warning - Some text.

Available List of parameters

{{ambox
| type       = delete / content / style / notice / move / protected
| image      = Picture.Png / Picture.Png|alt=Picture (if the parameter does not present, default type icon will be supplied)
| text       = Text for a big box, for the top of articles.

| style      = Different table style. (preferably should not be used)
| text-style = same as the above for text.

Article message box types

The following examples use different type parameters but use no image parameters thus they use the default images for each type.


Deletion.png

type=delete – Deletion issues, such as Template:S.

Content.png

type=content – Content issues, such as Template:S.

Edit-clear.png

type=style – Style issues, such as Template:S.

Notice.png

type=notice – Article notices, such as Template:S.

Move.png

type=move – Merge, split and transwiki proposals, such as Template:S.

Protection.png

type=protected – Protection notices, such as Template:S.

Other images

The default images shown above are mostly for convenience. In many cases it is more appropriate to use more specific images. These example use the image parameter to specify an image other than the default images.

{{ambox
| type  = notice
| image = OpenttdManual.png
| text  = Something Something Something 
}}

Something Something Something