Template:Custominfobox/doc: Difference between revisions

From GlyGen Wiki
Jump to navigation Jump to search
Line 1: Line 1:
== Common parameters ==
== Common parameters ==
The box below shows the most common parameters that are accepted by <code><nowiki>{{Warning}}</nowiki></code> template. The purpose of each is described below.
 
The box below shows the most common parameters that are accepted by <code><nowiki>{{Custominfobox}}</nowiki></code> template. The purpose of each is described below.
<pre>
<pre>
{{Custominfobox
{{Custominfobox
| type       = serious/content/style/merge/move/blank/warning/delete/speedy/protection/notice by default
| type         = serious/content/style/merge/move/blank/warning/delete/speedy/protection/notice by default
| image     = none/blank/[[Image:Some image.svg|40px]]
| stylebox    = border: 2px solid #B66D31; border-radius: 15px; background-color: #f28500;
| imageright = [[Image:Some image.svg|40px]]
| borderwidth  = 1px;
| text       = The message body text
| borderstyle  = solid/dashed/any border-style value;
| message   = warning/expand/attention
| borderradius = 15px/10px/5px;
| detail     = with: my details
| bordercolor  = #B66D31;/orange;
| signature = Your Name
| boxcolor    = #f28500/orange;
| date       = {{CURRENTMONTHNAME}} {{CURRENTYEAR}}
| image       = none/blank/[[Image:Some image.svg|40px]]
| imageright   = [[Image:Some image.svg|40px]]
| text         = The message body text
| message     = warning/expand/attention
| detail       = with: my details
| signature   = Your Name
| date         = {{CURRENTMONTHNAME}} {{CURRENTYEAR}}
}}
}}
</pre>
</pre>
=== ''pass template Warning'' ===
 
<pre>
=== ''default template'' ===
{{customeinfobox}}
Default Mirage template <code><nowiki>{{Customeinfobox}}</nowiki></code>
</pre>
:results in
:results in
{{Custominfobox}}
{{Custominfobox}}
<pre>
{{Custominfobox
|date={{CURRENTMONTHNAME}} {{CURRENTYEAR}}
}}
</pre>
:results in
{{Custominfobox
|date={{CURRENTMONTHNAME}} {{CURRENTYEAR}}
}}


=== ''type'' ===
=== ''type'' ===
The ''type'' parameter defines the colour of the left bar, and the image that is used by default. The type is chosen not on aesthetics but is based on the type of issue that the template describes. The seven available types and their default images are shown below.
The <code><nowiki>| type =</nowiki></code> parameter defines the colour of the left bar, and the image that is used by default. The type is chosen not on aesthetics but is based on the type of issue that the template describes. The seven available types and their default images are shown below.
{{Custominfobox
{{Custominfobox
|nocat=true
|nocat=true
| type  = speedy
| type  = speedy
| text  = type=<u>speedy</u> – Speedy deletion issues, such as [https://en.wikipedia.org/wiki/Template:Db-g1 patent nonsense] and [https://en.wikipedia.org/wiki/Template:Db-g3 vandalism]
| text  = type=<u>speedy</u> – Speedy deletion issues, such as [https://en.wikipedia.org/wiki/Template:Db-g1 patent nonsense] and [https://en.wikipedia.org/wiki/Template:Db-g3 vandalism]
| date  = {{{date|}}}
}}
}}
{{Custominfobox
{{Custominfobox
Line 41: Line 37:
| type  = delete
| type  = delete
| text  = type=<u>delete</u> – Deletion issues, such as article for deletion and proposed deletion.
| text  = type=<u>delete</u> – Deletion issues, such as article for deletion and proposed deletion.
| date  = {{{date|}}}
}}
}}
{{Custominfobox
{{Custominfobox
Line 47: Line 42:
| type  = warning
| type  = warning
| text  = type=<u>warning</u> – Warn about some issues on the page
| text  = type=<u>warning</u> – Warn about some issues on the page
| date  = {{{date|}}}
}}
}}
{{Custominfobox
{{Custominfobox
Line 53: Line 47:
| type  = serious
| type  = serious
| text  = type=<u>serious</u> – Stop hand. Preventing from doing a specific action.
| text  = type=<u>serious</u> – Stop hand. Preventing from doing a specific action.
| date  = {{{date|}}}
}}
}}
{{Custominfobox
{{Custominfobox
Line 59: Line 52:
| type  = content
| type  = content
| text  = type=<u>content</u> – Content issues, such as [https://glygen.ccrc.uga.edu/wiki/index.php/Template:POV POV] and [https://en.wikipedia.org/wiki/Template:Globalize globalize]
| text  = type=<u>content</u> – Content issues, such as [https://glygen.ccrc.uga.edu/wiki/index.php/Template:POV POV] and [https://en.wikipedia.org/wiki/Template:Globalize globalize]
| date  = {{{date|}}}
}}
}}
{{Custominfobox
{{Custominfobox
Line 65: Line 57:
| type  = style
| type  = style
| text  = type=<u>style</u> – Style issues, such as [https://en.wikipedia.org/wiki/Template:Cleanup cleanup] and [https://en.wikipedia.org/wiki/Template:Underlinked underlinked]
| text  = type=<u>style</u> – Style issues, such as [https://en.wikipedia.org/wiki/Template:Cleanup cleanup] and [https://en.wikipedia.org/wiki/Template:Underlinked underlinked]
| date  = {{{date|}}}
}}
}}
{{Custominfobox
{{Custominfobox
Line 71: Line 62:
| type  = blank
| type  = blank
| text  = type=<u>blank</u> – Plain text without image
| text  = type=<u>blank</u> – Plain text without image
| date  = {{{date|}}}
}}
}}
{{Custominfobox
{{Custominfobox
Line 77: Line 67:
| type  = notice
| type  = notice
| text  = type=<u>notice</u> – Article notices
| text  = type=<u>notice</u> – Article notices
| date  = {{{date|}}}
}}
}}
{{Custominfobox
{{Custominfobox
Line 83: Line 72:
| type  = move
| type  = move
| text  = type=<u>move</u> – Merge, split and transwiki proposals, such as [https://en.wikipedia.org/wiki/Template:Split split] and [https://en.wikipedia.org/wiki/Template:Copy_to_Wiktionary copy to Wiktionary]
| text  = type=<u>move</u> – Merge, split and transwiki proposals, such as [https://en.wikipedia.org/wiki/Template:Split split] and [https://en.wikipedia.org/wiki/Template:Copy_to_Wiktionary copy to Wiktionary]
| date  = {{{date|}}}
}}
}}
{{Custominfobox
{{Custominfobox
Line 89: Line 77:
| type  = merge
| type  = merge
| text  = type=<u>merge</u> – Merge, split and transwiki proposals
| text  = type=<u>merge</u> – Merge, split and transwiki proposals
| date  = {{{date|}}}
}}
}}
{{Custominfobox
{{Custominfobox
Line 95: Line 82:
| type  = protection
| type  = protection
| text  = type=<u>protection</u> – Protection notices, such as [https://en.wikipedia.org/wiki/Template:Pp-vandalism pp-vandalism] and [https://en.wikipedia.org/wiki/Template:Pp pp-protected]
| text  = type=<u>protection</u> – Protection notices, such as [https://en.wikipedia.org/wiki/Template:Pp-vandalism pp-vandalism] and [https://en.wikipedia.org/wiki/Template:Pp pp-protected]
| date  = {{{date|}}}
}}
}}


If no ''type'' parameter is given the template defaults to {{para|type|notice}}.
If no ''type'' parameter is given the template defaults to {{para|type|notice}}.
=== ''style'' ===
You can customize a infobox style by adding CSS3 to parameters below.
Using <code><nowiki>|stylebox = </nowiki></code> parameter you can add any CSS style to this <code><nowiki>{{Custominfobox}}</nowiki></code>. For an example, <code><nowiki>|stylebox = border: 2px solid #B66D31; border-radius: 15px; background-color: #f28500;</nowiki></code>
Also you can change <code><nowiki>{{Custominfobox}}</nowiki></code> style by using parametrs below.
<pre>
{{Custominfobox
| borderwidth  = 2px;
| borderstyle  = solid;
| borderradius = 10px;
| bordercolor  = #B8E0FF;
| boxcolor    = #E7F5FF;
| text        = This is a custom info box style
}}
</pre>
:results in
{{Custominfobox
| borderwidth  = 2px;
| borderstyle  = solid;
| borderradius = 10px;
| bordercolor  = #B8E0FF;
| boxcolor    = #E7F5FF;
| text        = This is a custom info box style
}}


=== ''image'' ===
=== ''image'' ===
You can choose a specific image to use for the template by using the ''image'' parameter. Images are specified using the standard syntax for inserting files in Wikipedia (see [[Wikipedia:Manual of Style/Images#How to place an image]].) Widths of 40-50px are typical.  
You can choose a specific image to use for the template by using the ''image'' parameter.  
<code><nowiki>| image = none/blank/[[Image:Some image.svg|40px]]</nowiki></code>
;Images available on Custominfobox
<pre>
| serious  = [[Image:Stop hand nuvola.svg|40px]]
| content  = [[Image:Emblem-important.svg|40px]]
| style    = [[Image:Broom icon.svg|40px]]
| merge    = [[Image:Merge-split-transwiki default.svg]]
| move    = [[Image:Ambox_move.png|40px]]
| blank    = [[Image:Spacer.gif]]
| warning  = [[File:Ambox warning orange.svg|40px]]
| delete  = [[File:Ambox warning red.svg|40px]]
| speedy  = [[File:Ambox warning red.svg|40px]]
| protection = [[Image:Ambox_protection.png|40px]]
| notice  = [[Image:Info non-talk.png|40px]]
| #default = {{{image|[[Image:Info non-talk.png|40px]]}}}
</pre>
 
:results in
{{Custominfobox
| image = [[Image:Broom icon.svg|40px]]
| text = This is <code><nowiki>| image = [[Image:Broom icon.svg|40px]]</nowiki></code>
}}
{{Custominfobox
| image = style
| text = This is <code><nowiki>| image = style</nowiki></code>
}}


*'''No parameter''' = means that no image parameter is given and template uses a default image. In this case <code><nowiki>|type = notice</nowiki></code>.
*'''No parameter''' = means that no image parameter is given and template uses a default image. In this case <code><nowiki>|type = notice</nowiki></code>.


*'''An image''' = usual width of an image is 40px - 50px.  
<pre>
{{Custominfobox
| text = Template uses a default image.  
}}
</pre>


*'''none''' = means that no image is used.
:results in
{{Custominfobox
| text = Template uses a default image.  
}}


*'''blank''' = means that no image is used but an empty area the same size as a default image is used, which means that text in the message box gets aligned well with other article message boxes. (See examples above.)
*'''An image''' = usual width of an image is 40px - 50px.  


For example:
*'''none''' = means that no image is used. <code><nowiki>image = none</nowiki></code>
:results in
{{Custominfobox
| image = none
| text = This is <code><nowiki>image = none</nowiki></code>
}}


* {{Tl|POV}} specifies {{Para|image|<nowiki>[[File:Unbalanced scales.svg|40px|link=|alt=]]</nowiki>}} and looks like this:
*'''blank''' = means that no image is used but an empty area the same size as a default image is used, which means that text in the message box gets aligned well with other article message boxes. <code><nowiki>image = </nowiki></code>
{{POV|date={{CURRENTMONTHNAME}} {{CURRENTYEAR}}}}
:results in
{{Custominfobox
| image =  
| text = This is a infobox with out image. <code><nowiki>image = </nowiki></code>
}}


=== ''imageright'' ===
=== ''imageright'' ===
To display image at the right parameter ''imageright'' can be used <code><nowiki>imageright = [[Image:Some image.svg|40px]]</nowiki></code>
<pre>
{{Customeinfobox
| imageright = [[Image:Emblem-important.svg|40px]]
| text = This is | imageright = [[Image:Emblem-important.svg|40px]]
}}
</pre>
:results in
{{Custominfobox
| imageright = [[Image:Emblem-important.svg|40px]]
| text = This is <code><nowiki>| imageright = [[Image:Emblem-important.svg|40px]]</nowiki></code>
}}


=== ''message'' ===
=== ''message'' ===
Line 130: Line 195:
:results in
:results in
{{Custominfobox|detail=the information on this page is inaccurate|date=May 2019}}
{{Custominfobox|detail=the information on this page is inaccurate|date=May 2019}}
=== ''signature'' ===
=== ''signature'' ===
To add your name you have to use <code><nowiki>signature=</nowiki></code>parameter.
To add your name you have to use <code><nowiki>signature=</nowiki></code>parameter.
Line 137: Line 203:


=== ''date'' ===
=== ''date'' ===
Either one of these <code><nowiki>| date =</nowiki></code> parameters will display date.
<pre>
{{Custominfobox
| date = {{CURRENTMONTHNAME}} {{CURRENTYEAR}}
| date  = Nov 22, 2019
}}
</pre>
:results in
{{Custominfobox
| date = {{CURRENTMONTHNAME}} {{CURRENTYEAR}}
}}


==Default values==
==Default values==

Revision as of 22:09, 22 November 2019

Common parameters

The box below shows the most common parameters that are accepted by {{Custominfobox}} template. The purpose of each is described below.

{{Custominfobox
| type         = serious/content/style/merge/move/blank/warning/delete/speedy/protection/notice by default
| stylebox     = border: 2px solid #B66D31; border-radius: 15px; background-color: #f28500;
| borderwidth  = 1px; 
| borderstyle  = solid/dashed/any border-style value; 
| borderradius = 15px/10px/5px;
| bordercolor  = #B66D31;/orange; 
| boxcolor     = #f28500/orange;
| image        = none/blank/[[Image:Some image.svg|40px]]
| imageright   = [[Image:Some image.svg|40px]]
| text         = The message body text
| message      = warning/expand/attention
| detail       = with: my details
| signature    = Your Name
| date         = {{CURRENTMONTHNAME}} {{CURRENTYEAR}}
}}

default template

Default Mirage template {{Customeinfobox}}

results in

type

The | type = parameter defines the colour of the left bar, and the image that is used by default. The type is chosen not on aesthetics but is based on the type of issue that the template describes. The seven available types and their default images are shown below.

If no type parameter is given the template defaults to |type=notice.

style

You can customize a infobox style by adding CSS3 to parameters below. Using |stylebox = parameter you can add any CSS style to this {{Custominfobox}}. For an example, |stylebox = border: 2px solid #B66D31; border-radius: 15px; background-color: #f28500; Also you can change {{Custominfobox}} style by using parametrs below.

{{Custominfobox
| borderwidth  = 2px; 
| borderstyle  = solid; 
| borderradius = 10px;
| bordercolor  = #B8E0FF; 
| boxcolor     = #E7F5FF;
| text         = This is a custom info box style
}}
results in

image

You can choose a specific image to use for the template by using the image parameter. | image = none/blank/[[Image:Some image.svg|40px]]

Images available on Custominfobox
| serious  = [[Image:Stop hand nuvola.svg|40px]]
| content  = [[Image:Emblem-important.svg|40px]]
| style    = [[Image:Broom icon.svg|40px]]
| merge    = [[Image:Merge-split-transwiki default.svg]]
| move     = [[Image:Ambox_move.png|40px]]
| blank    = [[Image:Spacer.gif]]
| warning  = [[File:Ambox warning orange.svg|40px]]
| delete   = [[File:Ambox warning red.svg|40px]]
| speedy   = [[File:Ambox warning red.svg|40px]]
| protection = [[Image:Ambox_protection.png|40px]]
| notice   = [[Image:Info non-talk.png|40px]]
| #default = {{{image|[[Image:Info non-talk.png|40px]]}}}
results in
  • No parameter = means that no image parameter is given and template uses a default image. In this case |type = notice.
{{Custominfobox
| text = Template uses a default image. 
}}
results in
  • An image = usual width of an image is 40px - 50px.
  • none = means that no image is used. image = none
results in
  • blank = means that no image is used but an empty area the same size as a default image is used, which means that text in the message box gets aligned well with other article message boxes. image =
results in

imageright

To display image at the right parameter imageright can be used imageright = [[Image:Some image.svg|40px]]

{{Customeinfobox
| imageright = [[Image:Emblem-important.svg|40px]]
| text = This is | imageright = [[Image:Emblem-important.svg|40px]]
}}
results in

message

text
detail

To add your specific detail message, you have to call parameter |detail=

Type {{Custominfobox|detail=the information on this page is inaccurate}}

This code will add period at the end of your message. {{#ifeq:{{{punctuation|{{{period|}}}}}}|no||.}}

results in

signature

To add your name you have to use signature=parameter. Type {{Custominfobox|signature=Tatiana}}

results in

date

Either one of these | date = parameters will display date.

{{Custominfobox
| date = {{CURRENTMONTHNAME}} {{CURRENTYEAR}}
| date  = Nov 22, 2019
}}
results in

Default values

If you transclude a template that expects parameters but do not provide their arguments, in this way: {{{Custominfobox}}} in the numbered parameters example above you would get the following:

Warning: There is a problem with this page.

In the parameters example above you would get the following:

Warning: There is a problem with this page with {{{detail}}}. {{{date}}}.

Since no arguments were passed in, the template presents the parameters themselves, instead of their respective values. In these cases, it may be useful to define default values for the parameters, i.e. values that will be used if no value is passed in. For example, if the template contents are changed to:

'''Warning:''' There is a problem with this page with: {{{detail}}}. {{{date|{{subst:CURRENTMONTHNAME}} {{subst:CURRENTYEAR}}}}}.

then {{{date|{{subst:CURRENTMONTHNAME}} {{subst:CURRENTYEAR}}}}}. defines that if no argument is provided for parameter {{{date}}}, then the value CURRENTDATE which is <small>''May 2019.''</small> will be used.

Similarly, {{{detail}}}, doesn't provide defaults parameter, that means no value will be added.

Now, transcluding the template again without passing any argument results in the following:

Warning: There is a problem with this page. May 2019.

Memo

Assign a parameter

{{#if:{{{with|{{{for|{{{signature|}}}}}}}}}|{{{with|{{{for|{{{signature}}}}}}}}}}}

Assign a parameter with default value

{{#if:|{{{date|}}}|<small>''({{{date|{{subst:CURRENTMONTHNAME}} {{subst:CURRENTYEAR}}}}})''</small>}} code style

Custominfobox template code

<!--{{Custominfobox}} begin-->
<table style="{{{style|}}}" class="metadata plainlinks ambox {{#switch:{{{type|}}}
  | serious  = ambox-delete
  | content  = ambox-content
  | style    = ambox-style
  | merge    = ambox-merge
  | move     = ambox-move
  | warning  = ambox-content
  | delete   = ambox-delete
  | speedy   = ambox-speedy
  | protection = ambox-protection
  | notice   = ambox-notice
  | #default = ambox-notice
}}">
<tr>
<td class="mbox-image" {{#ifeq:{{{image|}}}|none|style="padding:0 !important"}}>
{{#ifeq:{{{image}}}|none
  | <!-- no image cell; empty cell necessary for text cell to have 100% width -->
  | <div style="width:52px;"> {{#switch:{{{image|{{{type|}}}}}}
    | serious  = [[Image:Stop hand nuvola.svg|40px]]
    | content  = [[Image:Emblem-important.svg|40px]]
    | style    = [[Image:Broom icon.svg|40px]]
    | merge    = [[Image:Merge-split-transwiki default.svg]]
    | move     = [[Image:Ambox_move.png|40px]]
    | blank    = [[Image:Spacer.gif]]
    | warning  = [[File:Ambox warning orange.svg|40px]]
    | delete   = [[File:Ambox warning red.svg|40px]]
    | speedy   = [[File:Ambox warning red.svg|40px]]
    | protection = [[Image:Ambox_protection.png|40px]]
    | notice   = [[Image:Info non-talk.png|40px]]
    | #default = {{{image|[[Image:Info non-talk.png|40px]]}}}
  }}</div>
}}</td>
<td class="mbox-text">{{#if:|{{{text|}}}|{{{text|
{{#switch:{{{message|{{{message|}}}}}}
    | warning  = '''Warning:''' There is a problem with this page
    | expand   = This section '''needs expansion''' 
    | attention = '''Attention:''' This page requires attention
    | #default = ''This is a difault message''
 }}}}}}}{{#if:{{{with|{{{for|{{{detail|}}}}}}}}}
 |  with: {{{with|{{{for|{{{detail}}}}}}}}}}}{{#ifeq:{{{punctuation|{{{period|}}}}}}|no||.}} {{#if:{{{with|{{{for|{{{signature|}}}}}}}}}|''{{{with|{{{for|{{{signature}}}}}}}}}''}} {{#if:{{{with|{{{for|{{{date|}}}}}}}}}|''<small>({{{with|{{{for|{{{date}}}}}}}}})</small>''}}</td>
{{#if:{{{imageright|}}}|
  <td class="mbox-imageright"><div style="width:52px;"> {{{imageright}}} </div></td>
}}
</tr>
</table><noinclude>
{{Documentation}}
<!-- Add categories and interwikis to the /doc subpage, not here! -->
</noinclude><noinclude>