Module

Module:Portal/sandbox/doc

< Module:Portal‎ | sandbox
Revision as of 14:48, 11 September 2017 by Shawndouglas (talk | contribs) (Created as needed.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This is the documentation page for Module:Portal/sandbox

This module has two functions, portal and image. The portal produces a box with links to a portal or to multiple portals, and is used by the {{portal}} template. It is most often used in the "See also" section of an article. The image function produces the name of the image used by the specified portal.

Portal function

The portal function produces a box of portal links.

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

Parameters

{{Portal|Name 1|Name 2|Name 3...|size=Size|boxsize=Boxsize|margin=Margin}}
Name
The name of the portal. If multiple portal names are used the other parameters will be ignored.

The following additional 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.

|size=Size
The width of the icon, as an integer. This is in units of pixels. The default is 28 times the image aspect ratio, which produces an image 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.
|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).
|break=Break
If set to "Yes", adds a line break before the word "portal".

Images

The portal image defaults to one that is specified in Template:Portal/Images/PortalName for the portal, or a generic image. There is a list of all such images.

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|Science}}
{{Portal|Science|size=15}}
{{Portal|Science|boxsize=50}}

See also

Image function

The image function produces the name of the image used by the specified portal.

Usage

{{#invoke:Portal|image|portal}}

Example

  • {{#invoke:Portal|image|Art}}Lua error: Internal error: The interpreter exited with status 127.

Image dupes function

The image dupes function returns a list of all images that are being used by more than one portal (aliases are not included). This can be helpful in identifying image entries that should be changed to use aliases.

Usage

{{#invoke:Portal|imageDupes}}

Display all function

The display all function returns a box containing all portals that have images. This is used for maintenance, and should not be displayed in articles, because a) there are around 1500 portals with images, and displaying 1500 images on one page takes up a lot of server resources, and b) the module has no way to know the correct capitalization of a portal name, so some links to portals will be broken.

Usage

{{#invoke:Portal|displayAll}}