Template:Favilink: Difference between revisions

From Caves of Qud Wiki
Jump to navigation Jump to search
No edit summary
m (try "no html" instead of "nohtml" (RE specification here: https://www.mediawiki.org/wiki/Extension:Cargo/Querying_data))
Line 1: Line 1:
<includeonly><span class="qud-image"><span class="qud-image-link-image-container">{{#vardefine:pagelink|{{#cargo_query:table=GeneralData|fields=_pageName|where=_pageNamespace='0' AND PlainName='{{#replace:{{{1|}}}|'|''}}'|limit=1|more results text=|default={{{1|}}}|format=template|template=single query result|nohtml }} }}{{#ifexist: {{#cargo_query:table=GeneralData|fields=CONCAT('File:',Image)|where=_pageNamespace='0' AND PlainName='{{#replace:{{{1|}}}|'|''}}'|format=template|template=single query result|limit=1|more results text=|nohtml}} | [[File:{{#cargo_query:table=GeneralData|fields=Image|where=_pageNamespace='0' AND PlainName='{{#replace:{{{1|}}}|'|''}}'|format=template|template=single query result|limit=1|more results text=|default=|nohtml}}|16px|link={{{1|}}}]] | {{#cargo_query:table=GeneralData|fields=DisplayChar|where=_pageNamespace='0' AND PlainName='{{#replace:{{{1|}}}|'|''}}'|format=template|template=single query result|limit=1|more results text=|default=|nohtml}} }}</span><span class="qud-image-link" style="color:#b1c9c3;">[[{{#var:pagelink}}|{{#if: {{{2|}}}|{{Qud text|&y{{{2}}}|notxml}}|{{#cargo_query:table=GeneralData|fields=DisplayName|where=_pageNamespace='0' AND PlainName='{{#replace:{{{1|}}}|'|''}}'|limit=1|more results text=|default={{{1|}}}|nohtml}}}}]]</span></span></includeonly><noinclude>
<includeonly><span class="qud-image"><span class="qud-image-link-image-container">{{#vardefine:pagelink|{{#cargo_query:table=GeneralData|fields=_pageName|where=_pageNamespace='0' AND PlainName='{{#replace:{{{1|}}}|'|''}}'|limit=1|more results text=|default={{{1|}}}|format=template|template=single query result|no html }} }}{{#ifexist: {{#cargo_query:table=GeneralData|fields=CONCAT('File:',Image)|where=_pageNamespace='0' AND PlainName='{{#replace:{{{1|}}}|'|''}}'|format=template|template=single query result|limit=1|more results text=|no html}} | [[File:{{#cargo_query:table=GeneralData|fields=Image|where=_pageNamespace='0' AND PlainName='{{#replace:{{{1|}}}|'|''}}'|format=template|template=single query result|limit=1|more results text=|default=|no html}}|16px|link={{{1|}}}]] | {{#cargo_query:table=GeneralData|fields=DisplayChar|where=_pageNamespace='0' AND PlainName='{{#replace:{{{1|}}}|'|''}}'|format=template|template=single query result|limit=1|more results text=|default=|no html}} }}</span><span class="qud-image-link" style="color:#b1c9c3;">[[{{#var:pagelink}}|{{#if: {{{2|}}}|{{Qud text|&y{{{2}}}|notxml}}|{{#cargo_query:table=GeneralData|fields=DisplayName|where=_pageNamespace='0' AND PlainName='{{#replace:{{{1|}}}|'|''}}'|limit=1|more results text=|default={{{1|}}}|no html}}}}]]</span></span></includeonly><noinclude>
[[Category:Shorthand Templates]]
[[Category:Shorthand Templates]]
!!Currently only for use for objects in the tables: ItemsTable, Food, Corpses, Characters, Locations. All possible items can be found here: [[Special:CargoTables/GeneralData]]. If an item is missing, please let [[User:Teamtoto]] know.
!!Currently only for use for objects in the tables: ItemsTable, Food, Corpses, Characters, Locations. All possible items can be found here: [[Special:CargoTables/GeneralData]]. If an item is missing, please let [[User:Teamtoto]] know.

Revision as of 18:47, 20 August 2019

!!Currently only for use for objects in the tables: ItemsTable, Food, Corpses, Characters, Locations. All possible items can be found here: Special:CargoTables/GeneralData. If an item is missing, please let User:Teamtoto know.

Usage

Used similar to regular wikipage linking syntax. First argument takes name of the page and will pull the image from that item.

{{favilink|stopsvalinn}}

Stopsvalinn.pngStopsvalinn

You can also use a second argument to reword the link:

{{favilink|torch|A &Rreally&y spicy meatball}}

Torch.pngA really spicy meatball