Template:Portal/doc: Difference between revisions

From Zoophilia Wiki
Jump to navigationJump to search
meta>WOSlinker
m update usage count
No edit summary
Line 5: Line 5:


===Parameters===
===Parameters===
: <code>'''<nowiki>{{</nowiki>portal|<var>Name</var>|image=<var>Image</var>|size=<var>Size</var> |boxsize=<var>Boxsize</var> |break=yes |left=yes |margin=<var>Margin</var> |link=<var>Target</var> |alt=<var>Alt&nbsp;text</var> }}'''</code>
: <code>'''<nowiki>{{</nowiki>Portal|<var>Name</var>|image=<var>Image</var>|size=<var>Size</var>|boxsize=<var>Boxsize</var>|break=yes|left=yes|margin=<var>Margin</var>|link=<var>Target</var>|alt=<var>Alt text</var>}}'''</code>


The following parameters are available. They are all optional, the default values are chosen to give a good look and feel across the encylopedia and should not be overridden without good reason.
The following parameters are available. They are all optional, the default values are chosen to give a good look and feel across the encylopedia and should not be overridden without good reason.
Line 11: Line 11:
; <code><var>Name</var></code> : The name of the portal. <!-- This defaults to the current page's name - true but lets not encourage this.  If pages or sections are moved or copied stuff breaks. -->
; <code><var>Name</var></code> : The name of the portal. <!-- This defaults to the current page's name - true but lets not encourage this.  If pages or sections are moved or copied stuff breaks. -->


; {{para|image|<var>Image</var>}} : The image to use for the portal's icon. This defaults to an image that is specified in Template:Portal/Images/PortalName for the portal, or a generic image, and should not be overridden without good reason. There is a [[Template:Portal/Images|list of all such images]].
; {{Para|image|<var>Image</var>}} : The image to use for the portal's icon. This defaults to an image that is specified in Template:Portal/Images/PortalName for the portal, or a generic image, and should not be overridden without good reason. There is a [[Template:Portal/Images|list of all such images]].


; {{para|size|<var>Size</var>}} : The width of the icon, as an integer. This is in units of pixels. The default is 32. The icon is also constrained to be at most 28 pixels high.
; {{Para|size|<var>Size</var>}} : The width of the icon, as an integer. This is in units of pixels. The default is 32. The icon is also constrained to be at most 28 pixels high.


; {{para|boxsize|<var>Boxsize</var>}} : The width of the box, as an integer. This is in units of pixels. The default is to use a box wide enough to hold the text, if possible.
; {{Para|boxsize|<var>Boxsize</var>}} : The width of the box, as an integer. This is in units of pixels. The default is to use a box wide enough to hold the text, if possible.


; {{para|break|yes}} : In the text, put a line break between the portal's name and the word "portal".
; {{Para|break|yes}} : In the text, put a line break between the portal's name and the word "portal".


; {{para|left|yes}} : Float the box to the left instead of to the right.
; {{Para|left|yes}} : Float the box to the left instead of to the right.


; {{para|margin|<var>Margin</var>}} : The margin around the box. By default, the box is surrounded by a margin of width 0.5em, but this can be customized using {{para|margin|<var>top right bottom left</var>}} (''e.g.'', {{para|margin|0.25em 0 0.25em 0.25em}}) or removed using {{para|margin|0}} (zero).
; {{Para|margin|<var>Margin</var>}} : The margin around the box. By default, the box is surrounded by a margin of width 0.5em, but this can be customized using {{para|margin|<var>top right bottom left</var>}} (''e.g.'', {{para|margin|0.25em 0 0.25em 0.25em}}) or removed using {{para|margin|0}} (zero).


; {{para|link|<var>Target</var>}} : the link target for the image. If the target is empty, the image does not link to anything; if "<code>File:</code>", the image links to its file page; otherwise, the image links to the specified Wikipeda page or URL. The default is "<code>File:</code>" if <code><var>Image</var></code> is specified, and is empty otherwise. <code><var>Target</var></code> can be the name of a Wikipedia page, and it can be a URL. Normally the target should not also be a target of the adjacent text, as that would be [[WP:OVERLINKING|overlinking]]. If <code><var>Image</var></code> or nonempty <code><var>Target</var></code> is specified, nonempty <code><var>Alt text</var></code> should also be specified. The {{para|link}} parameter should not be used if that would conflict with the licensing requirements of the image; see ''[[Wikipedia:Alternative text for images #Purely decorative images|Purely decorative images]]''.
; {{Para|link|<var>Target</var>}} : the link target for the image. If the target is empty, the image does not link to anything; if "<code>File:</code>", the image links to its file page; otherwise, the image links to the specified Wikipeda page or URL. The default is "<code>File:</code>" if <code><var>Image</var></code> is specified, and is empty otherwise. <code><var>Target</var></code> can be the name of a Wikipedia page, and it can be a URL. Normally the target should not also be a target of the adjacent text, as that would be [[WP:OVERLINKING|overlinking]]. If <code><var>Image</var></code> or nonempty <code><var>Target</var></code> is specified, nonempty <code><var>Alt text</var></code> should also be specified. The {{para|link}} parameter should not be used if that would conflict with the licensing requirements of the image; see ''[[Wikipedia:Alternative text for images #Purely decorative images|Purely decorative images]]''.


; {{para|alt|<var>Alt&nbsp;text</var>}} : The alt text for the image, for visually impaired readers; see ''[[Wikipedia:Alternative text for images]]''.  The default is empty. If {{para|link|File:}} (or <code><var>Image</var></code> without any use of the {{para|link}} parameter) is specified, the alt text should describe the image's visual appearance; if {{para|link}} specifies some other nonempty link target, the alt text should describe the icon's function.
; {{Para|alt|<var>Alt&nbsp;text</var>}} : The alt text for the image, for visually impaired readers; see ''[[Wikipedia:Alternative text for images]]''.  The default is empty. If {{para|link|File:}} (or <code><var>Image</var></code> without any use of the {{para|link}} parameter) is specified, the alt text should describe the image's visual appearance; if {{para|link}} specifies some other nonempty link target, the alt text should describe the icon's function.


===Location===
===Location===
Line 35: Line 35:
! Code<hr/> !! Result<hr/>
! Code<hr/> !! Result<hr/>
|-
|-
| <small><pre>{{portal}}</pre></small>
| <small><pre>{{Portal}}</pre></small>
| {{portal}}
| {{Portal}}
|-
|-
| <small><pre>{{portal|Science}}</pre></small>
| <small><pre>{{Portal|Science}}</pre></small>
| {{portal|Science}}
| {{Portal|Science}}
|-
|-
| <small><pre>{{portal|Spaceflight|RocketSunIcon.svg|alt=Rocket orbiting star}}</pre></small>
| <small><pre>{{Portal|Spaceflight|RocketSunIcon.svg|alt=Rocket orbiting star}}</pre></small>
| {{portal|Spaceflight|RocketSunIcon.svg|alt=Rocket orbiting star}}
| {{Portal|Spaceflight|RocketSunIcon.svg|alt=Rocket orbiting star}}
|-
|-
| <small><pre>{{portal|Spaceflight|RocketSunIcon.svg|link=}}</pre></small>
| <small><pre>{{Portal|Spaceflight|RocketSunIcon.svg|link=}}</pre></small>
| {{portal|Spaceflight|RocketSunIcon.svg|link=}}
| {{Portal|Spaceflight|RocketSunIcon.svg|link=}}
|-
|-
| <small><pre>{{portal|Spaceflight|RocketSunIcon.svg |link=Special:Search
| <small><pre>{{Portal|Spaceflight|RocketSunIcon.svg |link=Special:Search
  |alt=Search spaceflight portal
  |alt=Search spaceflight portal
}}</pre></small>
}}</pre></small>
| {{portal|Spaceflight|RocketSunIcon.svg |link=Special:Search
| {{Portal|Spaceflight|RocketSunIcon.svg |link=Special:Search
  |alt=Search spaceflight portal
  |alt=Search spaceflight portal
}}
}}
|-
|-
| <small><pre>{{portal|Science|size=15}}</pre></small>
| <small><pre>{{Portal|Science|size=15}}</pre></small>
| {{portal|Science|size=15}}
| {{Portal|Science|size=15}}
|-
|-
| <small><pre>{{portal|Science|boxsize=50}}</pre></small>
| <small><pre>{{Portal|Science|boxsize=50}}</pre></small>
| {{portal|Science|boxsize=50}}
| {{Portal|Science|boxsize=50}}
|-
|-
| <small><pre>{{portal|Science|break=yes}}</pre></small>
| <small><pre>{{Portal|Science|break=yes}}</pre></small>
| {{portal|Science|break=yes}}
| {{Portal|Science|break=yes}}
|-
|-
| <small><pre>{{portal|Science|break=yes|left=yes}}</pre></small>
| <small><pre>{{Portal|Science|break=yes|left=yes}}</pre></small>
| {{portal|Science|break=yes|left=yes}}
| {{Portal|Science|break=yes|left=yes}}
|}
|}



Revision as of 20:28, 23 May 2010

This template is used to produce a link in a box to a portal.

Parameters

{{Portal|Name|image=Image|size=Size|boxsize=Boxsize|break=yes|left=yes|margin=Margin|link=Target|alt=Alt text}}

The following parameters are available. They are all optional, the default values are chosen to give a good look and feel across the encylopedia and should not be overridden without good reason.

Name
The name of the portal.
|image=Image
The image to use for the portal's icon. This defaults to an image that is specified in Template:Portal/Images/PortalName for the portal, or a generic image, and should not be overridden without good reason. There is a list of all such images.
|size=Size
The width of the icon, as an integer. This is in units of pixels. The default is 32. The icon is also constrained to be at most 28 pixels high.
|boxsize=Boxsize
The width of the box, as an integer. This is in units of pixels. The default is to use a box wide enough to hold the text, if possible.
|break=yes
In the text, put a line break between the portal's name and the word "portal".
|left=yes
Float the box to the left instead of to the right.
|margin=Margin
The margin around the box. 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).
|link=Target
the link target for the image. If the target is empty, the image does not link to anything; if "File:", the image links to its file page; otherwise, the image links to the specified Wikipeda page or URL. The default is "File:" if Image is specified, and is empty otherwise. Target can be the name of a Wikipedia page, and it can be a URL. Normally the target should not also be a target of the adjacent text, as that would be overlinking. If Image or nonempty Target is specified, nonempty Alt text should also be specified. The |link= parameter should not be used if that would conflict with the licensing requirements of the image; see Purely decorative images.
|alt=Alt text
The alt text for the image, for visually impaired readers; see Wikipedia:Alternative text for images. The default is empty. If |link=File: (or Image without any use of the |link= parameter) is specified, the alt text should describe the image's visual appearance; if |link= specifies some other nonempty link target, the alt text should describe the icon's function.

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|alt=Rocket orbiting star}}
{{Portal|Spaceflight|RocketSunIcon.svg|link=}}
{{Portal|Spaceflight|RocketSunIcon.svg |link=Special:Search
 |alt=Search spaceflight portal
}}
{{Portal|Science|size=15}}
{{Portal|Science|boxsize=50}}
{{Portal|Science|break=yes}}
{{Portal|Science|break=yes|left=yes}}

See also