PC Gaming Shelter
An archive dedicated to preserving PC Gaming history and more

Template:Link/doc: Difference between revisions

From PC Gaming Shelter
No edit summary
No edit summary
 
Line 32: Line 32:
</pre>
</pre>


It works best as a part of the Infobox system. Each infobox can have different groups of links (Store links, Download links, etc.). As a workaround that allows for re-using of the same template in forms with multiple link groups, we create ''aliases'' (redirects), e.g.:
It is designed to be a '''part of the Infobox system'''. Each infobox can have different groups of links (Store links, Download links, etc.). As a workaround that allows for re-using of the same template in forms with multiple link groups, we create ''aliases'' (redirects), e.g.:
* [[Template:Community link]]
* [[Template:Community link]]
* [[Template:Store link]]
* [[Template:Store link]]

Latest revision as of 10:17, 26 March 2026

A helper template that renders external links and stores their semantics in a subobject.

Template parameters

ParameterDescriptionTypeStatus
URLURL

A valid URL of the resource we want to link to.

URLrequired
Link textLink text

A visible text that masks the URL

Stringoptional
Link groupLink group

Allows for retrieval and grouping of links based on their similarity.

Stringoptional

Example

{{Link
|URL=
|Link text=
|Link group=
}}

It is designed to be a part of the Infobox system. Each infobox can have different groups of links (Store links, Download links, etc.). As a workaround that allows for re-using of the same template in forms with multiple link groups, we create aliases (redirects), e.g.:

They all use Template:Link to call Module:Link that:

  • escalates the URL to the direct page properties
  • stores all link parameters in a subobject
  • renders the link

So, the URL is accessible by the direct query while the detailed data can be retrieved via a subquery, depending on your needs.