Template:Portal/doc: Difference between revisions
meta>Eubulides Make it clearer that this default is only if an image is specified. |
meta>Eubulides Revert my recent changes to the documentation, as the proposed patch has not been installed yet, and the documentation should reflect current behavior. |
||
Line 4: | Line 4: | ||
This template is used to produce a link in a box to a [[Portal:List of portals|portal]]. | This template is used to produce a link in a box to a [[Portal:List of portals|portal]]. | ||
=== | ===Optional parameters=== | ||
<nowiki>{{</nowiki>'''portal'''|name|image|size|boxsize|break=yes|left=yes|margin=|alt=''Alt text''|link=''Link''}} | |||
The units assumed for <code>size</code> (the width of the image) and <code>boxsize</code> (the width of the box containing the image and portal link) are pixels (px). By default, the box is surrounded by a margin of width 0.5em, but this can be customized using <code>margin=''top'' ''right'' ''bottom'' ''left''</code> (e.g. <code style="font-size:95%;">margin=0.25em 0 0.25em 0.25em</code>) or removed using <code>margin=0</code> (zero). | |||
By default the image is assumed to be purely decorative, and no link is generated for it; in this case the image should not have a license that requires attribution, for technical reasons involving copyright law and the current implementation of Wikipedia. However, if <code>alt=''Alt text''</code> is specified (see [[WP:ALT]]), a link to the image's page is generated; this link can be overridden with <code>link=''Page to link to''</code>. As per [[WP:ALT]], if a link is specified, alt text for that link's function should also be specified. | |||
===Location=== | ===Location=== | ||
Within articles, this template is meant to be placed at the bottom of the article in the | Within articles, this template is meant to be placed at the bottom of the article in the "See also" section. | ||
===Examples=== | ===Examples=== | ||
{| style="background:transparent;" | {| style="background:transparent;" | ||
|- style="font-size:120%;" | |- style="font-size:120%;" | ||
! Code<hr/> !! Result<hr/> | ! Code<hr/> !! Result<hr/> | ||
|- | |- | ||
Line 46: | Line 27: | ||
| {{portal|Spaceflight|RocketSunIcon.svg}} | | {{portal|Spaceflight|RocketSunIcon.svg}} | ||
|- | |- | ||
| <small><pre>{{portal|Spaceflight|RocketSunIcon.svg | | | <small><pre>{{portal|Spaceflight|RocketSunIcon.svg|size=50}}</pre></small> | ||
| {{portal|Spaceflight|RocketSunIcon.svg|size=50}} | |||
}}</pre></small> | |||
| {{portal|Spaceflight|RocketSunIcon.svg | |||
|- | |- | ||
| <small><pre>{{portal| | | <small><pre>{{portal|Spaceflight|RocketSunIcon.svg|boxsize=50}}</pre></small> | ||
| {{portal| | | {{portal|Spaceflight|RocketSunIcon.svg|boxsize=50}} | ||
|- | |- | ||
| <small><pre>{{portal| | | <small><pre>{{portal|Spaceflight|RocketSunIcon.svg|break=yes}}</pre></small> | ||
| {{portal| | | {{portal|Spaceflight|RocketSunIcon.svg|break=yes}} | ||
|- | |- | ||
| <small><pre>{{portal| | | <small><pre>{{portal|Spaceflight|RocketSunIcon.svg|break=yes|left=yes}}</pre></small> | ||
| {{portal| | | {{portal|Spaceflight|RocketSunIcon.svg|break=yes|left=yes}} | ||
|} | |} | ||
Revision as of 23:31, 20 November 2009
This is a documentation subpage for Template:Portal. It may contain usage information, categories and other content that is not part of the original template page. |
This template is used to produce a link in a box to a portal.
Optional parameters
{{portal|name|image|size|boxsize|break=yes|left=yes|margin=|alt=Alt text|link=Link}}
The units assumed for size
(the width of the image) and boxsize
(the width of the box containing the image and portal link) are pixels (px). By default, the box is surrounded by a margin of width 0.5em, but this can be customized using margin=top right bottom left
(e.g. margin=0.25em 0 0.25em 0.25em
) or removed using margin=0
(zero).
By default the image is assumed to be purely decorative, and no link is generated for it; in this case the image should not have a license that requires attribution, for technical reasons involving copyright law and the current implementation of Wikipedia. However, if alt=Alt text
is specified (see WP:ALT), a link to the image's page is generated; this link can be overridden with link=Page to link to
. As per WP:ALT, if a link is specified, alt text for that link's function should also be specified.
Location
Within articles, this template is meant to be placed at the bottom of the article in the "See also" section.
Examples
Code |
Result |
---|---|
{{portal}} |
|
{{portal|Science}} |
|
{{portal|Spaceflight|RocketSunIcon.svg}} |
|
{{portal|Spaceflight|RocketSunIcon.svg|size=50}} |
|
{{portal|Spaceflight|RocketSunIcon.svg|boxsize=50}} |
|
{{portal|Spaceflight|RocketSunIcon.svg|break=yes}} |
|
{{portal|Spaceflight|RocketSunIcon.svg|break=yes|left=yes}} |
See also
- {{portalbox}}