|
|
Line 1: |
Line 1: |
| <code><nowiki>{{#invoke:SpecializationLink|renderLink|spec={{{1|{{{spec|}}} }}}|iconsize={{{2|{{{iconsize|}}} }}} }}</nowiki></code>
| | '''Documentation to be updated shortly.''' |
| | |
| | |
| This template is used like this: <code><nowiki>{{Specialization link|spec|iconsize}}</nowiki></code>
| |
| | |
| | |
| This template calls <code>renderLink</code> in '''Module:SpecializationLink''' to make icons and short wiki links to a specialization's page. The icon can be small, huge, or in between. The small icon is sized appropriately to fit well into in-line text.
| |
| | |
| This template standardizes the display of icons and specializations throughout the wiki and simplifies the amount of writing that is necessary when adding new content pages.
| |
| | |
| | |
| == Usage ==
| |
| | |
| Use the name of the specialization as it appears in the game.
| |
| | |
| Giving the template a specialization name will result in a text-sized icon and a link to the wiki page for that specialization . This is useful in-line with text in paragraphs, where specialization icons can still be recognized.
| |
| | |
| | |
| Telling the template what size to make the icon allows the icon to be larger and more distinguishable. This is useful when creating tables where a larger icon increases recognition. If you request a link to a specialization that doesn't exist, an error will appear.
| |
| | |
| The default is a small icon, for use in-line with text. You can also use <code>med</code>, <code>large</code>, <code>huge</code>, or write <code>small</code> explicitly, to describe the desired size of the icon, as you can see below.
| |
| | |
| | |
| Here are ways to call the template and the expected result:
| |
| | |
| {| class="wikitable"
| |
| ! Argument !! Examples !! Expected outcome
| |
| |-
| |
| | None
| |
| |style="white-space: nowrap"| <code><nowiki>{{Specialization link}}</nowiki></code>
| |
| | An error.
| |
| |-
| |
| | Specialization name or <br /> Specialization name and a "small" icon size
| |
| |style="white-space: nowrap"| <code><nowiki>{{Specialization link|Farming}}</nowiki></code> <br /> <code><nowiki>{{Specialization link|Alchemy|small}}</nowiki></code>
| |
| | A small, text-sized icon and link to the wiki page for the specialization.
| |
| |-
| |
| | Specialization name and a "med" icon size
| |
| |style="white-space: nowrap"| <code><nowiki>{{Specialization link|Farming|med}}</nowiki></code> <br /> <code><nowiki>{{Specialization link|Meat production|med}}</nowiki></code>
| |
| | A fair-sized specialization icon and a link to its wiki page.
| |
| |-
| |
| | Specialization name and a "large" icon size
| |
| |style="white-space: nowrap"| <code><nowiki>{{Specialization link|Farming|large}}</nowiki></code> <br /> <code><nowiki>{{Specialization link|Wood|large}}</nowiki></code>
| |
| | A large specialization icon and a link to its wiki page.
| |
| |-
| |
| | Resource name and a "huge" icon size
| |
| |style="white-space: nowrap"| <code><nowiki>{{Specialization link|Farming|huge}}</nowiki></code> <br /> <code><nowiki>{{Specialization link|Engineering|huge}}</nowiki></code>
| |
| | A very large specialization icon and a link to its wiki page.
| |
| |}
| |
| | |
| | |
| == Examples ==
| |
| | |
| The following are generated by calling the template, as shown in the examples in the table above.
| |
| | |
| | |
| 1. <code><nowiki>{{Specialization link|Farming}}</nowiki></code> yields:
| |
| | |
| {{Specialization link|Farming}}
| |
| | |
| | |
| 2. <code><nowiki>{{Specialization link|Farming|med}}</nowiki></code> yields:
| |
| | |
| {{Specialization link|Farming|med}}
| |
| | |
| | |
| 3. <code><nowiki>{{Specialization link|Farming|large}}</nowiki></code> yields:
| |
| | |
| {{Specialization link|Farming|large}}
| |
| | |
| | |
| 4. <code><nowiki>{{Specialization link|Farming|huge}}</nowiki></code> yields (currently the same as <code>large</code>, since the icons are not high enough resolution to render that big).
| |
| | |
| {{Specialization link|Farming|huge}}
| |
| | |
| | |
| The following are error messages generated by calling the template incorrectly.
| |
| | |
| | |
| 5. With no arguments, <code><nowiki>{{Specialization link}}</nowiki></code> yields:
| |
| | |
| '''{{Specialization link}}'''
| |
| | |
| | |
| 6. With the name of something that doesn't exist in the game, <code><nowiki>{{Specialization link|Meat}}</nowiki></code> yields:
| |
| | |
| '''{{Specialization link|Meat}}'''
| |
| | |
| | |
| 7. With no specialization but an icon size, <code><nowiki>{{Specialization link||large}}</nowiki></code> yields:
| |
| | |
| '''{{Specialization link||large}}'''
| |
| | |
| | |
| Finally, providing an icon size that is not recognized does not break the template.
| |
| | |
| | |
| 8. With a valid specialization but invalid icon size, <code><nowiki>{{Specialization link|Farming|gigantic}}</nowiki></code> yields:
| |
| | |
| {{Specialization link|Farming|gigantic}}
| |