Difference between revisions of "Template:Quote"

From Stoneshard wiki
Jump to navigation Jump to search
(error check for pages without switch statement (non-item pages))
(Load weapon and armor description into quote from new Data pages if Quote is used without parameters.)
Line 1: Line 1:
<includeonly>{| style="background:transparent"
<includeonly>-->{{#vardefine:Description|{{#ifeq:{{:Weapon_data|{{ROOTPAGENAME}}|Description}}|Data does not exist.|{{#ifeq:{{:Armor_data|{{ROOTPAGENAME}}|Description}}|Data does not exist.|Quote missing!|{{:Armor_data|{{ROOTPAGENAME}}|Description}}}}|{{:Weapon_data|{{ROOTPAGENAME}}|Description}}}}}}<!--
-->{| style="background:transparent"
|-valign="top"
|-valign="top"
{{ #if: {{{4|}}} | {{!}} {{ #if: {{{2|}}} | style="padding-top: 1.6em;" rowspan="2" {{!}} }} [[File:{{{4}}}|64px]] }}
{{ #if: {{{4|}}} | {{!}} {{ #if: {{{2|}}} | style="padding-top: 1.6em;" rowspan="2" {{!}} }} [[File:{{{4}}}|64px]] }}
| style="color: #ff9900; font-size: 3.3em; font-family: 'Times New Roman',serif; font-weight: bold; padding: 4px 2px 2px; width: 0.5em; vertical-align: top;" | “
| style="color: #ff9900; font-size: 3.3em; font-family: 'Times New Roman',serif; font-weight: bold; padding: 4px 2px 2px; width: 0.5em; vertical-align: top;" | “
| style="padding-top: 1.6em;" |''{{#ifeq:{{SUBPAGENAME}}|{{PAGENAME}}|{{#if:{{{1|}}}|{{{1|}}}|{{#iferror:{{:{{ROOTPAGENAME}}|Description}}|Quote missing!|{{:{{ROOTPAGENAME}}|Description}}}}}}|{{#if:{{{1|}}}|{{{1|}}}|{{#if:{{Translate|{{ROOTPAGENAME}}|ItemDescriptions}}|{{Translate|{{ROOTPAGENAME}}|ItemDescriptions}}|Translation missing!}}}}}}''
| style="padding-top: 1.6em;" |''{{#ifeq:{{SUBPAGENAME}}|{{PAGENAME}}|{{#if:{{{1|}}}|{{{1|}}}|{{#var:Description}}}}|{{#if:{{{1|}}}|{{{1|}}}|{{#if:{{Translate|{{ROOTPAGENAME}}|ItemDescriptions}}|{{Translate|{{ROOTPAGENAME}}|ItemDescriptions}}|Translation missing!}}}}}}''
| style="color: #ff9900; font-size: 3.3em; font-family: 'Times New Roman',serif; font-weight: bold; padding: 4px 2px 2px; width: 0.5em; vertical-align: bottom;" | „
| style="color: #ff9900; font-size: 3.3em; font-family: 'Times New Roman',serif; font-weight: bold; padding: 4px 2px 2px; width: 0.5em; vertical-align: bottom;" | „
{{#if: {{{2|}}} |  
{{#if: {{{2|}}} |  

Revision as of 21:10, 22 August 2022

Template-info.png Documentation

This template is used to quote a person or source. The color of the quotes themselves should be changed to match the wiki skin color palette.

Usage

{{Quote|This is a quote.}} prints:

-->{| style="background:transparent" |-valign="top"

| style="color: #ff9900; font-size: 3.3em; font-family: 'Times New Roman',serif; font-weight: bold; padding: 4px 2px 2px; width: 0.5em; vertical-align: top;" | “ | style="padding-top: 1.6em;" |This is a quote. | style="color: #ff9900; font-size: 3.3em; font-family: 'Times New Roman',serif; font-weight: bold; padding: 4px 2px 2px; width: 0.5em; vertical-align: bottom;" | „

|}

{{Quote|This is a quote.|Author}} prints:

-->{| style="background:transparent" |-valign="top"

| style="color: #ff9900; font-size: 3.3em; font-family: 'Times New Roman',serif; font-weight: bold; padding: 4px 2px 2px; width: 0.5em; vertical-align: top;" | “ | style="padding-top: 1.6em;" |This is a quote. | style="color: #ff9900; font-size: 3.3em; font-family: 'Times New Roman',serif; font-weight: bold; padding: 4px 2px 2px; width: 0.5em; vertical-align: bottom;" | „ |- | | style="text-align: right;" | ~ Author | |}

{{Quote|This is a quote.|Author|subject}} prints:

-->{| style="background:transparent" |-valign="top"

| style="color: #ff9900; font-size: 3.3em; font-family: 'Times New Roman',serif; font-weight: bold; padding: 4px 2px 2px; width: 0.5em; vertical-align: top;" | “ | style="padding-top: 1.6em;" |This is a quote. | style="color: #ff9900; font-size: 3.3em; font-family: 'Times New Roman',serif; font-weight: bold; padding: 4px 2px 2px; width: 0.5em; vertical-align: bottom;" | „ |- | | style="text-align: right;" | ~ Author on subject | |}

{{Quote|This is a quote.|[[Main Page|Some guy]]|subject}} prints:

-->{| style="background:transparent" |-valign="top"

| style="color: #ff9900; font-size: 3.3em; font-family: 'Times New Roman',serif; font-weight: bold; padding: 4px 2px 2px; width: 0.5em; vertical-align: top;" | “ | style="padding-top: 1.6em;" |This is a quote. | style="color: #ff9900; font-size: 3.3em; font-family: 'Times New Roman',serif; font-weight: bold; padding: 4px 2px 2px; width: 0.5em; vertical-align: bottom;" | „ |- | | style="text-align: right;" | ~ Some guy on subject | |}

{{Quote|This is a quote.|[[Main Page|Some guy]]|subject|Broom.png}} prints:

-->{| style="background:transparent" |-valign="top" | style="padding-top: 1.6em;" rowspan="2" | Broom.png | style="color: #ff9900; font-size: 3.3em; font-family: 'Times New Roman',serif; font-weight: bold; padding: 4px 2px 2px; width: 0.5em; vertical-align: top;" | “ | style="padding-top: 1.6em;" |This is a quote. | style="color: #ff9900; font-size: 3.3em; font-family: 'Times New Roman',serif; font-weight: bold; padding: 4px 2px 2px; width: 0.5em; vertical-align: bottom;" | „ |- | | style="text-align: right;" | ~ Some guy on subject | |}

Images are automatically scaled in width to 64px.

Automatic Quotes

In addition, you can use Quote without any parameters to automatically display the description on any item and enemy page. There are several possible outcomes:

{{Quote}}

On english item pages, like Templar Sword, it will display the english description.

On item pages in different languages, like Templar Sword/ru, it will display the russian description translation.

If the translation is not defined (check in Category:Language_templates), it will display the english description by default.

If the translation is defined as nothing (ie. |Templar Sword = ), it will display "Translation missing!".

If you use Quote without any parameters on a non-item non-enemy page, like Characters, it will display "Quote missing!".