模板:Portal-inline/doc

来自决策链云智库
< 模板:Portal-inline
Zeroclanzhang讨论 | 贡献2024年1月20日 (六) 19:57的版本 (创建页面,内容为“{{Documentation subpage}} {{#ifeq:{{SUBPAGENAME}}|sandbox||{{High-use}}}} {{Lua|Module:Portal-inline}} '''Template:Portal-inline''' is used to produce an inline link to a portal that is supported by print and mobile versions of Wikipedia pages. == Differences between <nowiki>{{Portal}} and {{Portal-inline}}</nowiki> == {{tl|Portal}} creates a list of one or more portal links within an accessible navigation region. It is hidden in…”)
(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)

Template:Portal-inline is used to produce an inline link to a portal that is supported by print and mobile versions of Wikipedia pages.

Differences between {{Portal}} and {{Portal-inline}}

{{Portal}} creates a list of one or more portal links within an accessible navigation region. It is hidden in printer and mobile view. This is useful, for example, in an article's "See also" section.

{{Portal-inline}} creates one portal link with no accessibility context. It is visible in printer and mobile view. This is useful, for example, if making a mid-sentence link on a talk page, or if there is an alternative list structure in a "See also" section.

Usage

  • {{Portal-inline|<name> }}
  • {{Portal-inline|<name> [|size= <size> ] [|text= <text> ] [|short= <anything> ]}}

Everything inside square brackets is optional, do not include the square brackets.

Parameters

  • 1 — required; The first unnamed/positional parameter is the name of the portal.
  • size— optional; Specify |size=tiny to show a 16×16 image instead of the usual size.
  • text— optional; Specify |text=(name) for a different associated name to appear.
  • short— optional; Specify |short=anything to remove portal from the output.
  • redlinks— optional; Specify |redlinks=yes to show the portal if it is redlinked.

Examples

Using only the name parameter

  • Code: {{Portal-inline|Canada}}
  • Produces:

Using the name and size parameters

  • Code: {{Portal-inline|Canada|size=tiny}}
  • Produces:

Using the name and text parameters

  • Code: {{Portal-inline|Canada|text=Canadian portal}}
  • Produces:

Using the name and short parameters

  • Code: {{Portal-inline|Canada|short=yes}}
  • Produces:

Right align element

See: {{Portal|<border=no>}}

Lists

In an article's "See also" section, to generate an accessible list of portal links, use {{portal}}. If a different list structure is preferred, prefix each {{portal-inline}} with an asterisk.

* {{Portal-inline|Canada}}
* {{Portal-inline|Feminism}}
  • Produces:

Right align element

See {{Portal|<border=no>}}

Image

The portal image name is found using Module:Portal. Please see Module:Portal for instructions on how to add, update, or remove an image.

Error tracking

If the template is used incorrectly, the page will be added to a tracking category.

The tracking categories are not applied if any of the following is true:

  1. Tracking is specially disabled for that usage. This is done by setting the optional parameter |tracking= to any the following values: no, n, false
  2. the template is used on a page in any of these namespaces: Talk, User, User talk, Wikipedia talk, File talk, Template talk, Category talk, Portal talk, Draft, Draft talk, Module talk
  3. The title page on which the template is used includes any of the following case-insensitive strings: "/archive", "/doc", "/test"

TemplateData

This is the TemplateData for this template used by TemplateWizard, VisualEditor and other tools. See a monthly parameter usage report for Template:Portal-inline in articles based on its TemplateData.

TemplateData for Portal-inline

Produce an inline link to a portal with an image.

模板参数

此模板首选参数不换行的行内格式。

参数描述类型状态
11

Name of the portal to link to.

示例值
Science
页面名称必需
Sizesize

Set to "tiny" to show a 16×16 image instead of the usual size.

示例值
tiny
字符串可选
Texttext

Show a different name instead of the portal name.

示例值
Portal of science
字符串可选
Shortshort

Set to any value to exclude "portal" from the output.

示例值
yes
布尔可选
Red linksredlinks

Set to "yes" to show the portal even if it is redlinked.

示例值
yes
布尔可选

See also

模板:Portal template list