Template:Userbox: Difference between revisions

From PZwiki
m (added category)
m (done)
(10 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<includeonly><div style="float:{{{float|right}}}; border:{{{border-width|{{{border-s|1}}}}}}px solid {{{border-color|{{{1|{{{border-c|{{{id-c|#999}}}}}}}}}}}}; margin:1px;" class="wikipediauserbox">
<noinclude>
{| cellspacing="0" style="width:238px; background:{{{info-background|{{{2|{{{info-c|#EEE}}}}}}}}};"
{{Documentation/sandbox|doc =
{{#if:{{{logo|{{{3|{{{id|id}}}}}}}}}|
This template can be used to quickly create a [[wikipedia:Wikipedia:Userboxes|userbox]] for display on a user's [[wikipedia:Wikipedia:User pages|user page]] without having to know HTML or Wikitable syntax.
! style="width:{{{logo-width|{{{id-w|45}}}}}}px; height:{{{logo-height|{{{id-h|45}}}}}}px; background:{{{logo-background|{{{1|{{{id-c|#DDD}}}}}}}}}; text-align:center; font-size:{{{logo-size|{{{5|{{{id-s|14}}}}}}}}}pt; color:{{{logo-color|{{{id-fc|black}}}}}}; padding:{{{logo-padding|{{{id-p|1px}}}}}}; line-height:{{{logo-line-height|{{{id-lh|1.25em}}}}}}; vertical-align: middle; {{{logo-other-param|{{{id-op|}}}}}}" {{!}} {{{logo|{{{3|{{{id|id}}}}}}}}}
 
==Usage==
This template is used to create a new userbox. If you want to add an existing userbox to your user page, please check templates in {{ll|PZwiki:Userboxes}}.
 
===Syntax===
Most HTML-based tables use only a handful of these attributes. The following subset can be used to quickly convert an HTML userbox into the format used here:
<pre>
{{Userbox
| logo =
| logo-color =
| info =
| info-color =
| cat =
}}
}}
| style="text-align:left; font-size:{{{info-size|{{{info-s|8}}}}}}pt; padding:{{{info-padding|{{{info-p|4px}}}}}}; height:{{{logo-height|{{{id-h|45}}}}}}px; line-height:{{{info-line-height|{{{info-lh|1.25em}}}}}}; color:{{{info-color|{{{info-fc|black}}}}}}; vertical-align: middle; {{{info-other-param|{{{info-op|}}}}}}" | {{{info|{{{4|{{{info|''info''}}}}}}}}}
</pre>
|}</div>{{#if:{{{usercategory|}}}{{{usercategory2|}}}{{{usercategory3|}}}|{{cat handler
 
|nocat = {{{nocat|}}}
===Parameters===
|subpage = {{#if:{{{nocatsubpages|}}}|no}}
;<code>logo</code> {{sup|required}}
|user = {{#if:{{{usercategory|}}}|[[Category:{{{usercategory}}}]]}}{{#if:{{{usercategory2|}}}|[[Category:{{{usercategory2}}}]]}}{{#if:{{{usercategory3|}}}|[[Category:{{{usercategory3}}}]]}}
:logo image and/or text.
|template = {{#if:{{{usercategory|}}}|[[Category:{{{usercategory}}}| {{BASEPAGENAME}}]]}}{{#if:{{{usercategory2|}}}|[[Category:{{{usercategory2}}}| {{BASEPAGENAME}}]]}}{{#if:{{{usercategory3|}}}|[[Category:{{{usercategory3}}}| {{BASEPAGENAME}}]]}}
;<code>logo-color</code>
}}}}</includeonly><noinclude>{{documentation}}[[Category:User templates]]</noinclude>
:logo background color.
;<code>info</code> {{sup|required}}
:info text.
;<code>info-color</code>
:info background color.
;<code>cat</code>
:user category, omit "Category:" prefix.
 
==Examples==
*{{tll|Userbox}}
{{Userbox}}
*{{tll|Userbox|logo=[[File:SpiffoWave.png|link=]]|info=Spiffo welcomes you to the wiki!}}
{{Userbox|logo=[[File:SpiffoWave.png|link=]]|info=Spiffo welcomes you to the wiki!}}
 
{{Translation guide}}
 
==See also==
*{{ll|PZwiki:Userboxes}}
}}
{{ll|Category:Userbox}}
{{ll|Category:Metatemplates}}
</noinclude><includeonly><div class="userbox">{{#if:{{{cat|}}}|[[Category:{{{cat}}}]]}}
  <div {{#if:{{{logo-color|}}}|style="background-color: {{{logo-color}}};"}}>{{{logo}}}</div>
  <div {{#if:{{{info-color|}}}|style="background-color: {{{info-color}}};"}}>
{{{info}}}
  </div>
</div></includeonly>

Revision as of 14:28, 10 January 2024

Notebook.pngTemplate Documentation

This template can be used to quickly create a userbox for display on a user's user page without having to know HTML or Wikitable syntax.

Usage

This template is used to create a new userbox. If you want to add an existing userbox to your user page, please check templates in PZwiki:Userboxes.

Syntax

Most HTML-based tables use only a handful of these attributes. The following subset can be used to quickly convert an HTML userbox into the format used here:

{{Userbox
| logo = 
| logo-color = 
| info = 
| info-color = 
| cat = 
}}

Parameters

logo Required
logo image and/or text.
logo-color
logo background color.
info Required
info text.
info-color
info background color.
cat
user category, omit "Category:" prefix.

Examples

{{{logo}}}

{{{info}}}

SpiffoWave.png

Spiffo welcomes you to the wiki!

How to translate

This template doesn't need to/shouldn't be translated, but you can translate the documentation of this template with the following steps:

  1. Create a subpage of this template with the language code of the language you want to translate to.
  2. Copy the code wrapped in the <noinclude> tag in this template into the page you created.
    {{Translation guide}} template should be removed from the translated documentation.
  3. Translate the page according to the translation requirements of normal pages.

See also

Editors can experiment in this template's sandbox.