Template:Ambox: Difference between revisions

From 118Wiki
Jump to navigation Jump to search
(added ambox-delete & ambox-protection per Mediawiki:Common.css; tracking category system; display:none to replace blank; starting doc)
(case insensitive parameters; hide parameter text if empty; lock image for protection type; documentation)
Line 1: Line 1:
{| style="{{{style|}}}" class="metadata plainlinks ambox {{#switch:{{{type|}}}
{| style="{{{style|}}}" class="metadata plainlinks ambox {{#switch:{{lc:{{{type|}}}}}
   | delete|serious  = ambox-serious
   | delete|serious  = ambox-serious
   | content  = ambox-content
   | content  = ambox-content
Line 9: Line 9:
}}">
}}">
|-
|-
| class="ambox-image" | {{#ifeq:{{{image}}}|none
| class="ambox-image" | {{#ifeq:{{lc:{{{image}}}}}|none
   | <!-- no image cell; empty cell necessary for text cell to have 100% width -->
   | <!-- no image cell; empty cell necessary for text cell to have 100% width -->
   | <div style="width:52px;"> {{#switch:{{{image|{{{type|}}}}}}
   | <div style="width:52px;"> {{#switch:{{{image|{{{type|}}}}}}
Line 17: Line 17:
     | merge    = [[File:Merge-split-transwiki default.svg|link=]]
     | merge    = [[File:Merge-split-transwiki default.svg|link=]]
     | notice  = [[File:Info non-talk.png|40px|link=]]
     | notice  = [[File:Info non-talk.png|40px|link=]]
     | protection = [[File:Info non-talk.png|40px|link=]]
     | protection = [[File:Lock.svg|x40px|link=]]
     | blank    = <span style="display:none">blank</div>
     | blank    = <span style="display:none">blank</div>
     | #default = {{{image|[[File:Info non-talk.png|40px|link=]]}}}
     | #default = {{{image|[[File:Info non-talk.png|40px|link=]]}}}
   }}</div>
   }}</div>
}}
}}
| class="ambox-text" | {{{text}}}
| class="ambox-text" | {{{text|}}}
{{#if:{{{imageright|}}}|
{{#if:{{{imageright|}}}|
   {{!}} class="ambox-imageright" style="width:52px;" {{!}} {{{imageright}}}
   {{!}} class="ambox-imageright" style="width:52px;" {{!}} {{{imageright}}}
}}
}}
|}
|}
{{#ifeq: {{{includecat|}}} | no | | {{#if: {{{category|}}} | [[Category:{{{category}}}]] }} }}<noinclude>{{Documentation|CONTENT=
{{#ifeq: {{lc:{{{includecat|}}}}} | no | | {{#if: {{{category|}}} | [[Category:{{{category}}}]] }} }}<noinclude>
 
{{Documentation|CONTENT=
For the creation of Wiki article message boxes.
For the creation of Wiki article message boxes.


== Usage ==
Full usage:
<pre>{{Ambox
|type =
|text =
|style =
|image =
|imageright =
|category =
|includecat =
}}</pre>
'''text''' determines the text within the main body of the template. Use this to explain the purpose of the notice and possibly give instructions.
'''type''' parameter determines the color of the colorband on left and the default image by the intention of the template. The different types are as follows:
* "Serious" is used for major issues conserning the page, such as nomination for deletion. Type "Delete" can also be used, but it's currently identical with "serious".
{{Ambox|type=serious|text=Hello world!}}
{{Ambox|type=serious|text=Hello world!}}
* "Content" is used for issues in the content of the page that affect the quality and reliability of the page to the reader.
{{Ambox|type=content|text=Hello world!}}
{{Ambox|type=content|text=Hello world!}}
* "Style" is used for issues in the styling of the page that may make it difficult to read or stand out among similar pages, but don't affect the content of the page itself.
{{Ambox|type=style|text=Hello world!}}
{{Ambox|type=style|text=Hello world!}}
* "Merge" may be used to indicate the page should be merged, split, moved or altered in similar way.
{{Ambox|type=merge|text=Hello world!}}
{{Ambox|type=merge|text=Hello world!}}
* "Protection" may be used to indicate that the page is being protected against disallowed changes.
{{Ambox|type=protection|text=Hello world!}}
{{Ambox|type=protection|text=Hello world!}}
* "Notice" may be used to give readers information about the page without indicating it is an issue. This is the default type in case no type is given.
{{Ambox|type=notice|text=Hello world!}}
{{Ambox|type=notice|text=Hello world!}}
* "Blank" may be useful for some purposes.
{{Ambox|type=blank|text=Hello world!}}
{{Ambox|type=blank|text=Hello world!}}
'''style''' parameter allows including CSS style choices.
'''image''' parameter allows changing the left image from type specific default to another. Writing "none" will remove the image on the left completely. For optional image, use form <nowiki>[[File:File name|40px]]</nowiki> or similar.
<pre>{{Ambox|type=content|text=Hello world!|image=none}}</pre>
{{Ambox|type=content|text=Hello world!|image=none}}
<pre>{{Ambox|type=content|text=Hello world!|image=[[File:Award-goldstar.png|40px]]}}</pre>
{{Ambox|type=content|text=Hello world!|image=[[File:Award-goldstar.png|40px]]}}
'''imageright''' parameter allows including an image to the right of the template box. Use similar form as in '''image'''.
<pre>{{Ambox|type=content|text=Hello world!|imageright=[[File:Award-goldstar.png|40px]]}}</pre>
{{Ambox|type=content|text=Hello world!|imageright=[[File:Award-goldstar.png|40px]]}}
'''category''' parameter allows a tracking category for pages with this template. Only use the name of the category, without "Category:" in front.
'''includecat''' parameter disables the tracking category for an instant. This way the template can be used for showcasing without including it to the tracking category. Write "no" to disable the tracking category.
}}
}}
[[Category:Wiki System Templates]]
[[Category:Wiki System Templates]]
</noinclude>
</noinclude>

Revision as of 15:42, 2 February 2024


Template Documentation
For the creation of Wiki article message boxes.

Usage

Full usage:

{{Ambox
|type = 
|text = 
|style = 
|image = 
|imageright = 
|category = 
|includecat = 
}}

text determines the text within the main body of the template. Use this to explain the purpose of the notice and possibly give instructions.

type parameter determines the color of the colorband on left and the default image by the intention of the template. The different types are as follows:

  • "Serious" is used for major issues conserning the page, such as nomination for deletion. Type "Delete" can also be used, but it's currently identical with "serious".
  • "Content" is used for issues in the content of the page that affect the quality and reliability of the page to the reader.
  • "Style" is used for issues in the styling of the page that may make it difficult to read or stand out among similar pages, but don't affect the content of the page itself.
  • "Merge" may be used to indicate the page should be merged, split, moved or altered in similar way.
  • "Protection" may be used to indicate that the page is being protected against disallowed changes.
  • "Notice" may be used to give readers information about the page without indicating it is an issue. This is the default type in case no type is given.
  • "Blank" may be useful for some purposes.


style parameter allows including CSS style choices.

image parameter allows changing the left image from type specific default to another. Writing "none" will remove the image on the left completely. For optional image, use form [[File:File name|40px]] or similar.

{{Ambox|type=content|text=Hello world!|image=none}}
{{Ambox|type=content|text=Hello world!|image=[[File:Award-goldstar.png|40px]]}}


imageright parameter allows including an image to the right of the template box. Use similar form as in image.

{{Ambox|type=content|text=Hello world!|imageright=[[File:Award-goldstar.png|40px]]}}


category parameter allows a tracking category for pages with this template. Only use the name of the category, without "Category:" in front.

includecat parameter disables the tracking category for an instant. This way the template can be used for showcasing without including it to the tracking category. Write "no" to disable the tracking category.