Template:Building link/doc: Difference between revisions

From Against the Storm Official Wiki
m →Other examples: reordering examples within this section
swapped out old Apothecarys example for new -ies example
 
(8 intermediate revisions by the same user not shown)
Line 2: Line 2:


Creates a link to a building's page.
Creates a link to a building's page.
The template validates that you have correctly spelled the building name and can include an icon. Any links returned by this template '''should''' have articles and not be redlinks.


A shortcut template exists for this template, [[Template:bl]]. You can use <code><nowiki>{{bl}}</nowiki></code> instead of <code><nowiki>{{Building link}}</nowiki></code> with the same parameters.
A shortcut template exists for this template, [[Template:bl]]. You can use <code><nowiki>{{bl}}</nowiki></code> instead of <code><nowiki>{{Building link}}</nowiki></code> with the same parameters.
Line 16: Line 18:
! Parameter !! Type !! Description
! Parameter !! Type !! Description
|-
|-
| name || string || The name of the building, as it appears in the game.
| name || string || '''Required.''' The name of the building, as it appears in the game.
|}
|}


Line 32: Line 34:
* <code>large</code>
* <code>large</code>
* <code>huge</code>
* <code>huge</code>
The default for buildings is <code>medium</code>, which is larger than line heights in paragraphs but is large enough to be recognizable.
The default for buildings is <code>none</code>, suitable for paragraphs.
|-
|-
| display || string || If you include <code>display=notext</code> only the icon will be rendered. There are currently no other options for this parameter.
| display || string || If you include <code>display=notext</code> only the icon will be rendered. There are currently no other options for this parameter.
Line 39: Line 41:
|}
|}


Building links that are written into paragraphs should use either no icon or a small icon, neither of which is the default. The small icon for buildings is not recognizable (compared to species, resources, or specializations). Avoid it unless necessary, but it is available in case it is needed.
Building links that are written into paragraphs should use no icon, which is the default. The small icon for buildings is not recognizable (compared to species, resources, or specializations). Avoid it unless necessary, but it is available in case it is needed.


Note that adding "s" after the template call no longer includes the "s" in the link as it used to.
Note that adding "s" after the template call no longer includes the "s" in the link as it used to.
Line 47: Line 49:
=== Basic usage ===
=== Basic usage ===


<pre>{{Building link|Ranch}}</pre>
<pre>{{Building link|Trappers' Camp}}</pre>
Yields a suitably sized icon for recognition and use in tables:
Makes a simple text-only link to the {{Building link|Trappers' Camp}} article for use in-line in paragraphs like this that discuss villagers trapping and gathering things. Remember that using the small version of building icons like the {{Building link|Trappers' Camp|size=small}} is strongly advised against, because there aren't enough pixels to make them recognizable to the broad audience of this wiki.


{{Building link|Ranch}}


<pre>{{Building link|Trappers' Camp|size=medium}}</pre>
Yields an icon just big enough to be recognizable. Suitable for tables that list the buildings where layout provides some space for icons:


<pre>{{Building link|Trapper's Camp|size=none}}</pre>
{{Building link|Trappers' Camp|size=medium}}
Skips the icon, like in {{Building link|Trappers' Camp|size=none}} so it's easy to flow into paragraphs about villagers trapping and gathering things. The small version of building icons isn't very recognizable, as you can see in {{Building link|Trappers' Camp|size=small}} so no icon is strongly advised.




<pre>{{Building link|name=Ranch|large}}</pre>
<pre>{{Building link|Ranch|large}}</pre>
Yields a larger icon for great recognition:
Yields a larger icon for good recognition for use in tables with space that allows it:


{{Building link|name=Ranch|large}}
{{Building link|Ranch|large}}




<pre>{{Building link|Ranch|size=huge}}</pre>
<pre>{{Building link|Ranch|size=huge}}</pre>
Yields the largest icon, which is great for headlining tables about this building:
Yields the largest icon, which is great for headlining tables featuring this building:


{{Building link|Ranch|size=huge}}
{{Building link|Ranch|size=huge}}
Line 70: Line 72:
=== Other examples ===
=== Other examples ===


<pre>{{Building link|Ranch|s}}</pre>
<pre>{{Building link|Ranch|es}}</pre>
Formats the link so the name appears plural, but still links to the correct page (hover to see tooltip, or click):
Formats the link so the name appears plural, but still links to the correct page (hover to see tooltip, or click):


{{Building link|Ranch|s}}
{{Building link|Ranch|es}}




<pre>{{Building link|Apothecary|s|size=none}}</pre>
<pre>{{Building link|Apothecary|ies|size=none}}</pre>
Mentioning how important {{Building link|Apothecary|s|size=none}} are to your villagers does format the building name correctly as plural. The pages for the names of buildings ending in ''-y'' when plural like the {{Building link|Brewery|s|size=none}} have already been created as redirect pages, so you may use them freely:
Mentioning how important {{Building link|Apothecary|ies|size=none}} are to your villagers just requires an extra switch to tell the template you need the ''-y'' replaced with ''-ies'' to format the building name correctly as plural.
* {{Building link|Apothecary|s|size=none}}
* {{Building link|Bakery|s|size=none}}
* {{Building link|Beanery|s|size=none}}
* {{Building link|Brewery|s|size=none}}
* {{Building link|Distillery|s|size=none}}
* {{Building link|Granary|s|size=none}}
* {{Building link|Manufactory|s|size=none}}
* {{Building link|Monastery|s|size=none}}
* {{Building link|Smithy|s|size=none}}
* {{Building link|Tinctury|s|size=none}}




<pre>{{Building link|Trappers' Camp|s|size=gigantic}}</pre>
<pre>{{Building link|Trappers' Camp|s|size=gigantic}}</pre>
Specifying an icon size that is not recognized does not return an error. Instead, the default medium-sized icon is used:
Specifying an icon size that is not recognized does not return an error. Instead, it defaults to no icon:


{{Building link|Trappers' Camp|s|size=gigantic}}
{{Building link|Trappers' Camp|s|size=gigantic}}
Line 101: Line 93:
<pre>{{Building link}}</pre>
<pre>{{Building link}}</pre>
With no arguments: {{Building link}}
With no arguments: {{Building link}}


<pre>{{Building link|Library}}</pre>
<pre>{{Building link|Library}}</pre>
Naming a building that doesn't exist in the game: {{Building link|Library}}
Naming a building that doesn't exist in the game: {{Building link|Library}}
<pre>{{Building link|huge|Ranch|es}}</pre>
The same goes for swapping the order of the parameters so that the building is not first: {{Building link|huge|Ranch|es}}

Latest revision as of 03:26, 28 October 2025

Overview

Creates a link to a building's page.

The template validates that you have correctly spelled the building name and can include an icon. Any links returned by this template should have articles and not be redlinks.

A shortcut template exists for this template, Template:bl. You can use {{bl}} instead of {{Building link}} with the same parameters.

Parameters

Building

The name of the building is the only required parameter. Use the name as it appears in-game, including apostrophes (for example, the Woodcutters' Camp—not Woodcutter's Camp). A missing or mispelled (or mis-punctuated) building name will result in an error.

If you do not wish to write the code name=, you may skip that, but you must specify the name of the building before any other parameters.

Parameter Type Description
name string Required. The name of the building, as it appears in the game.

Output overrides

All of these parameters are optional and change how the link is formatted.

Parameter Type Description
size string The size of the icon to display. Choose one of the following:
  • none
  • small
  • medium
  • large
  • huge

The default for buildings is none, suitable for paragraphs.

display string If you include display=notext only the icon will be rendered. There are currently no other options for this parameter.
unnamed parameter string Including this formats the link with the plural name of the building. You may use either s or es to append it to the end of the link in a highly readable way, like this: {{bl|Cookhouse|s}}.

Building links that are written into paragraphs should use no icon, which is the default. The small icon for buildings is not recognizable (compared to species, resources, or specializations). Avoid it unless necessary, but it is available in case it is needed.

Note that adding "s" after the template call no longer includes the "s" in the link as it used to.

Examples

Basic usage

{{Building link|Trappers' Camp}}

Makes a simple text-only link to the Trappers' Camp article for use in-line in paragraphs like this that discuss villagers trapping and gathering things. Remember that using the small version of building icons like the Trappers' Camp is strongly advised against, because there aren't enough pixels to make them recognizable to the broad audience of this wiki.


{{Building link|Trappers' Camp|size=medium}}

Yields an icon just big enough to be recognizable. Suitable for tables that list the buildings where layout provides some space for icons:

Trappers' Camp Trappers' Camp


{{Building link|Ranch|large}}

Yields a larger icon for good recognition for use in tables with space that allows it:

Ranch Ranch


{{Building link|Ranch|size=huge}}

Yields the largest icon, which is great for headlining tables featuring this building:

Ranch Ranch

Other examples

{{Building link|Ranch|es}}

Formats the link so the name appears plural, but still links to the correct page (hover to see tooltip, or click):

Ranches


{{Building link|Apothecary|ies|size=none}}

Mentioning how important Apothecaries are to your villagers just requires an extra switch to tell the template you need the -y replaced with -ies to format the building name correctly as plural.


{{Building link|Trappers' Camp|s|size=gigantic}}

Specifying an icon size that is not recognized does not return an error. Instead, it defaults to no icon:

[Building Link size not valid: gigantic]

Errors

The following are error messages generated by calling the template incorrectly.

{{Building link}}

With no arguments: [Building Link needs building name]


{{Building link|Library}}

Naming a building that doesn't exist in the game: [Building not found: Library]


{{Building link|huge|Ranch|es}}

The same goes for swapping the order of the parameters so that the building is not first: [Building Link size not valid: Ranch]