Template:Favilink: Difference between revisions

From Caves of Qud Wiki
Jump to navigation Jump to search
(source code?)
(Undo revision 5264 by Teamtoto (talk))
Line 4: Line 4:
{{#ifeq: {{#cargo_query:table=GeneralData|fields=Image|where=_pageNamespace='0'AND _pageName='{{#replace:{{{1|}}}|'|''}}'|format=list|default=NONE}}| NONE | |{{#cargo_query:table=GeneralData|fields=CONCAT('[[File:',Image,'|16x24px|top]]')|where=_pageNamespace='0'AND _pageName='{{#replace:{{{1|}}}|'|''}}'|format=list}}}}
{{#ifeq: {{#cargo_query:table=GeneralData|fields=Image|where=_pageNamespace='0'AND _pageName='{{#replace:{{{1|}}}|'|''}}'|format=list|default=NONE}}| NONE | |{{#cargo_query:table=GeneralData|fields=CONCAT('[[File:',Image,'|16x24px|top]]')|where=_pageNamespace='0'AND _pageName='{{#replace:{{{1|}}}|'|''}}'|format=list}}}}
</span>  
</span>  
<span class="plainlinks" style="font-family:Source Code Pro">[{{canonicalurl:{{{1|}}}}} {{#if: {{{2|}}}|{{Qud text|&y{{{2}}}|notxml}}|{{#cargo_query:table=GeneralData|fields=DisplayName|where=_pageNamespace='0' AND _pageName='{{#replace:{{{1|}}}|'|''}}'}}}}]</span>
<span class="plainlinks">[{{canonicalurl:{{{1|}}}}} {{#if: {{{2|}}}|{{Qud text|&y{{{2}}}|notxml}}|{{#cargo_query:table=GeneralData|fields=DisplayName|where=_pageNamespace='0' AND _pageName='{{#replace:{{{1|}}}|'|''}}'}}}}]</span>
</span>  
</span>  
</span></includeonly><noinclude>
</span></includeonly><noinclude>

Revision as of 00:41, 7 August 2019

!!Currently only for use for objects in the tables: ItemsTable, Food, Corpses, Characters. 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.png Stopsvalinn

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

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

Torch.png A really spicy meatball