Difference between revisions of "Template:Friendly"
Jump to navigation
Jump to search
old>Realpsojed m (fix residence param) |
(added customizable image) |
||
(9 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
<includeonly>{| width=300px; | <includeonly>{| width=300px; | ||
|style="text-align:center;"|[[File:{{ROOTPAGENAME}}.png|link={{ROOTPAGENAME}}/Tooltip|alt={{ROOTPAGENAME}}|{{ROOTPAGENAME}}]] | |style="text-align:center;"|[[File:{{#if:{{:{{ROOTPAGENAME}}|Image}}|{{:{{ROOTPAGENAME}}|Image}}|{{ROOTPAGENAME}}.png}}|link={{ROOTPAGENAME}}/Tooltip|alt={{ROOTPAGENAME}}|{{ROOTPAGENAME}}]] | ||
|colspan="2" style="text-align:center;"|'''{{C|Brown|Name:}}''' {{ROOTPAGENAME}}<br><br>'''{{C|Brown|Occupation:}}''' {{:{{ROOTPAGENAME}}|Occupation}}<br>'''{{C|Brown|Residence:}}''' {{:{{ROOTPAGENAME}}|Residence}}<br>'''{{C|Brown|Sells:}}''' {{:{{ROOTPAGENAME}}| | |colspan="2" style="text-align:center;"|'''{{C|Brown|Name:}}''' {{#if:{{:{{ROOTPAGENAME}}|Name}}|{{:{{ROOTPAGENAME}}|Name}}|{{ROOTPAGENAME}}}}<br><br>'''{{C|Brown|Occupation:}}''' {{:{{ROOTPAGENAME}}|Occupation}}<br>'''{{C|Brown|Residence:}}''' {{:{{ROOTPAGENAME}}|Residence}}{{#if:{{:{{ROOTPAGENAME}}|Sells}}|<br>'''{{C|Brown|Sells:}}''' {{:{{ROOTPAGENAME}}|Sells}}}} | ||
|}</includeonly><noinclude>{{doc}} | |}{{#if: {{#titleparts: {{PAGENAME}} | 1 | 2}} | {{#ifeq: {{PAGENAME}} | {{ROOTPAGENAME}}/Tooltip |[[Category:NPC tooltips]]|{{#if: {{#titleparts: {{PAGENAME}} | 1 | 3}}|[[Category:{{uc:{{#titleparts: {{PAGENAME}} | 1 | 2}}}} NPC tooltips]]|[[Category:{{uc:{{#titleparts: {{PAGENAME}} | 1 | 2}}}} NPCs]]}}}}|[[Category: NPCs]]}}</includeonly><noinclude>{{doc}} | ||
[[Category:Tooltip templates]]</noinclude> | [[Category:Tooltip templates]]</noinclude> |
Latest revision as of 20:17, 7 April 2024
Documentation
[purge]
This is template created for use together with the Template:Tooltip hover box template on a specific Friendly NPC's page or Friendly NPC's tooltip page.
Usage: The page itself must contain the Friendly NPC's data before this Template works. For example, if I wanted to create the Frid page, I'll add this code to the start of the page:
<includeonly>{{#switch: {{{1}}} |Name = (optional) |Occupation = Herbalist |Residence = Osbrook |Sells = Herbs, Medicine, Scrolls |#default = }}</includeonly>
This data is invisible on the page itself, thanks to the includeonly tags.
Next, copy this code to Frid or Frid/Tooltip or Frid/anything page:
{{ {{{1|Tooltip hover box}}} |title= {{Friendly}} }}
It will automatically load the sword's data and fill them into this format. Go to Frid's page to see the result.