Difference between revisions of "Template:Sign/Documentation"

From GodWiki
Jump to: navigation, search
(Update docs)
m
 
(21 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
==Parameters==
 
==Parameters==
All parameters are optional.
+
===Global parameters===
:'''{{para|title}}''': The box title (default: no title)
+
; {{para|title}} : ''Optional'' - The title in '''bold''' of the sign (default: no title)
:'''{{para|text}}''': Text inside the box (default: a mess of lorem ipsum)
+
:'''{{para|bgcolor}}''': Background color in RGB format with no sign of # (default: fefefe)
+
; {{para|text}} : ''Required'' - The text content of the sign (default: a mess of lorem ipsum)  
:'''{{para|bordercolor}}''': Border color of the left (for harmony with the picture and the background; default: 999)  
 
:'''{{para|outerbordercolor}}''': Color of the top, right and bottom borders (default: AAB)
 
:'''{{para|img}}''': An image filename without the prefix "Image:" (default: Important.png)
 
:'''{{para|imgwidth}}''': Width of image. Use with care, or preferably do not use. (default: 64)
 
:'''{{para|cat}}''': A category without the prefix "Category:" (default: none).
 
:: Add the page where this sign is placed to the specified category.
 
:: ''Note:'' Use of {{para|cat}} needs to be protected (<code>&lt;includeonly&gt;</code> at least) when {{tl|Sign}} is used in other templates.
 
:'''{{para|height}}''': the height of the template (default: auto)
 
:'''{{para|width}}''': the width of the template (default: 100%, see also '''{{para|margins}}''')
 
:'''{{para|interval}}''': the bottom margin in pixels (default: 1)
 
:'''{{para|margins}}''': the left and right margins of the box (default: <code>3em</code>)
 
  
===Margins vs. width===
+
; {{para|bgcolor|<var>Valid CSS color string</var>}} : ''Optional'' - The background color (default: <code>#fefefe</code>)
Making this template narrower by setting the {{para|width}} parameter is strongly discouraged, as it is not portable across different-sized devices. If you need to narrow the box, increase the value of {{para|margins}} instead.
+
 +
; {{para|bordercolor|<var>Valid CSS color string</var>}} : ''Optional'' - The color of the left border (default: <code>#999</code>)
 +
 +
; {{para|outerbordercolor|<var>Valid CSS color string</var>}} : ''Optional'' - The color of the top, right and bottom borders (default: <code>#AAB</code>)
  
==Example of use==
+
=== Picture parameters===
<pre>
+
 
{{Sign
+
; {{para|img|<var>filename</var>}} : ''Optional'' - An image filename (default: <code>Important.png</code>)
 +
 
 +
;{{para|imgwidth|<var>Valid width in <code>px</code> pixel units</var>}} : ''Optional'' - For non-standard images. (default: <code>64px</code>)
 +
 +
;{{para|image-align}} : ''Optional'' - Override image <code>vertical-align</code> parameter: <code>top</code>, <code>bottom</code>, etc. (default: <code>middle</code>)
 +
 
 +
;{{para|link|<var>Name of the targeted page</var>}} : ''Optional'' - the link of the picture of the <code>|img </code> parameter become the specified target.
 +
:* If the parameter is not called at all in the template, the link will be <code>File:<filename></code> by default.
 +
:* If the parameter is called but no target is provided (<code>link=</code>), the linking will be turn off.
 +
 
 +
;{{para|emoji|<var>Any emoji</var>}} : ''Optional'' - Display an emoji instead of the image.
 +
:* If an emoji is used, the picture will not be displayed even if <code>|img=</code> is used.
 +
 
 +
;{{para|emojiwidth|<var>X%</var>}} : ''Optional'' - The width of the emoji in percent (default: 300%)
 +
 
 +
===Advanced parameters===
 +
 
 +
; {{para|height}} : ''Optional'' - the height of the template in CSS units (<code>rem</code>, <code>em</code>, <code>px</code>, etc.) (default: <code>auto</code>)
 +
 
 +
; {{para|width}} : ''Optional'' - the width of the template in CSS units (<code>rem</code>, <code>em</code>, <code>px</code>, etc.) (default: <code>100%</code>)
 +
 
 +
; {{para|interval}} : ''Optional'' - the bottom margin for the sign template in CSS units (<code>rem</code>, <code>em</code>, <code>px</code>, etc.) (default: <code>0.2rem</code>)
 +
 
 +
; {{para|style}} : ''Optional'' - any general CSS style parameters to be added to the table style. Takes valid CSS. End with a semicolon (<code>;</code>), '''DO NOT''' include quotation marks.
 +
 
 +
== Examples ==  
 +
<pre><nowiki>
 +
{{Sign  
 
| title = What a nice example!
 
| title = What a nice example!
| text = <nowiki>[[User:Spode|Spode]]</nowiki> is clearly a genius
+
| text = [[User:Spode|Spode]] is clearly a genius
| bgcolor = abcdef
+
| bgcolor = #abcdef
 
| img = Imbox notice.png
 
| img = Imbox notice.png
 
| outerbordercolor = red
 
| outerbordercolor = red
 
| bordercolor = green
 
| bordercolor = green
| margins = 10em
+
| width = 50%
}}</pre>
+
}}
 +
</Nowiki></pre>
 
'''Results in:'''  
 
'''Results in:'''  
 
{{Sign  
 
{{Sign  
 
| title = What a nice example!
 
| title = What a nice example!
 
| text = [[User:Spode|Spode]] is clearly a genius
 
| text = [[User:Spode|Spode]] is clearly a genius
| bgcolor = abcdef
+
| bgcolor = #abcdef
 
| img = Imbox notice.png
 
| img = Imbox notice.png
 
| outerbordercolor = red
 
| outerbordercolor = red
 
| bordercolor = green
 
| bordercolor = green
| margins = 10em
+
| width = 50%
 +
}}
 +
<br>
 +
----
 +
----
 +
 
 +
<pre><nowiki>
 +
{{Sign
 +
| title = Another example
 +
| link= Template:Sign/Documentation
 +
| text = The picture will link to the documentation of this template
 +
| bgcolor = silver
 +
| outerbordercolor = black
 +
| bordercolor = purple
 +
| width = 50%
 +
}}
 +
</Nowiki></pre>
 +
 
 +
 
 +
'''Results in:'''
 +
 
 +
{{Sign
 +
| title = Another example
 +
| link= Template:Sign/Documentation
 +
| text = The picture's link will lead to the documentation of this template.
 +
| bgcolor = silver
 +
| outerbordercolor = black
 +
| bordercolor = purple
 +
| width = 50%
 +
}}
 +
 
 +
----
 +
----
 +
 
 +
<pre><nowiki>
 +
{{Sign
 +
| title = No link example
 +
| link=
 +
| text = The picture's linking is desactivated with <code>link=</code>
 +
| bgcolor = MediumSeaGreen
 +
| outerbordercolor = black
 +
| bordercolor = red
 +
| width = 50%
 
}}
 
}}
<noinclude>[[Category:Templates/Documents|{{PAGENAME}}]]</noinclude>
+
</Nowiki></pre>
 +
 
 +
'''Results in:'''
 +
 
 +
{{Sign
 +
| title = No link example
 +
| link=
 +
| text = The picture's linking is desactivated with <code>link=</code>
 +
| bgcolor = MediumSeaGreen
 +
| outerbordercolor = black
 +
| bordercolor = red
 +
| width = 50%
 +
}}
 +
 
 +
----
 +
----
 +
 
 +
<pre><nowiki>
 +
{{Sign
 +
| title = Emoji example
 +
| emoji = 🐈
 +
| img = Example.jpg
 +
| text = Despite the image parameter being used, only the cat emoji is displayed.
 +
| bgcolor = Salmon
 +
| outerbordercolor = black
 +
| bordercolor = Blue
 +
| width = 50%
 +
}}
 +
</Nowiki></pre>
 +
 
 +
'''Results in:'''
 +
 
 +
{{Sign
 +
| title = Emoji example
 +
| emoji = 🐈
 +
| img = Example.jpg
 +
| text = Despite the image parameter being used, only the cat emoji is displayed.
 +
| bgcolor = Salmon
 +
| outerbordercolor = black
 +
| bordercolor = Blue
 +
| width = 50%
 +
}}
 +
 
 +
<noinclude> [[Category:Templates/Documents|{{PAGENAME}}]]</noinclude>

Latest revision as of 13:00, 18 December 2019

Parameters

Global parameters

|title= 
Optional - The title in bold of the sign (default: no title)
|text= 
Required - The text content of the sign (default: a mess of lorem ipsum)
|bgcolor=Valid CSS color string 
Optional - The background color (default: #fefefe)
|bordercolor=Valid CSS color string 
Optional - The color of the left border (default: #999)
|outerbordercolor=Valid CSS color string 
Optional - The color of the top, right and bottom borders (default: #AAB)

Picture parameters

|img=filename 
Optional - An image filename (default: Important.png)
|imgwidth=Valid width in px pixel units 
Optional - For non-standard images. (default: 64px)
|image-align= 
Optional - Override image vertical-align parameter: top, bottom, etc. (default: middle)
|link=Name of the targeted page 
Optional - the link of the picture of the |img parameter become the specified target.
  • If the parameter is not called at all in the template, the link will be File:<filename> by default.
  • If the parameter is called but no target is provided (link=), the linking will be turn off.
|emoji=Any emoji 
Optional - Display an emoji instead of the image.
  • If an emoji is used, the picture will not be displayed even if |img= is used.
|emojiwidth=X% 
Optional - The width of the emoji in percent (default: 300%)

Advanced parameters

|height= 
Optional - the height of the template in CSS units (rem, em, px, etc.) (default: auto)
|width= 
Optional - the width of the template in CSS units (rem, em, px, etc.) (default: 100%)
|interval= 
Optional - the bottom margin for the sign template in CSS units (rem, em, px, etc.) (default: 0.2rem)
|style= 
Optional - any general CSS style parameters to be added to the table style. Takes valid CSS. End with a semicolon (;), DO NOT include quotation marks.

Examples

{{Sign 
| title = What a nice example!
| text = [[User:Spode|Spode]] is clearly a genius
| bgcolor = #abcdef
| img = Imbox notice.png
| outerbordercolor = red
| bordercolor = green
| width = 50%
}}

Results in:

Imbox notice.png

What a nice example!

Spode is clearly a genius




{{Sign 
| title = Another example
| link= Template:Sign/Documentation
| text = The picture will link to the documentation of this template
| bgcolor = silver
| outerbordercolor = black
| bordercolor = purple
| width = 50%
}}


Results in:

Important.png

Another example

The picture's link will lead to the documentation of this template.


{{Sign 
| title = No link example
| link= 
| text = The picture's linking is desactivated with <code>link=</code>
| bgcolor = MediumSeaGreen
| outerbordercolor = black
| bordercolor = red
| width = 50%
}}

Results in:

Important.png

No link example

The picture's linking is desactivated with link=


{{Sign 
| title = Emoji example
| emoji = 🐈
| img = Example.jpg
| text = Despite the image parameter being used, only the cat emoji is displayed.
| bgcolor = Salmon
| outerbordercolor = black
| bordercolor = Blue
| width = 50%
}}

Results in:

🐈

Emoji example

Despite the image parameter being used, only the cat emoji is displayed.