Difference between revisions of "Template:Bug Header"

From Nookipedia, the Animal Crossing wiki
m (Capitalization fix)
m (Capitalization fix.)
Line 1: Line 1:
{{#vardefine:number|{{#cargo_query:|tables=nh_bug|fields=number|where=nh_bug._pageTitle='<includeonly>{{#switch:{{PAGENAME}}|Rajah brooke's birdwing=Rajah brooke\'s birdwing|Queen Alexandra's birdwing=Queen Alexandra\'s birdwing|{{PAGENAME}}}}</includeonly><noinclude>Yellow butterfly</noinclude>'|no html}}}}{{#vardefine:leftname|{{#cargo_query:|tables=nh_bug|fields=name|where=nh_bug.number='{{#ifeq:{{PAGENAME}}|Common butterfly|80|{{#expr:{{#var:number}}-1}}}}'|no html}}}}{{#vardefine:rightname|{{#cargo_query:|tables=nh_bug|fields=name|where=nh_bug.number='{{#ifeq:{{PAGENAME}}|Scorpion|1|{{#expr:{{#var:number}}+1}}}}'|no html}}}}
+
{{#vardefine:number|{{#cargo_query:|tables=nh_bug|fields=number|where=nh_bug._pageTitle='<includeonly>{{#switch:{{PAGENAME}}|Rajah Brooke's birdwing=Rajah Brooke\'s birdwing|Queen Alexandra's birdwing=Queen Alexandra\'s birdwing|{{PAGENAME}}}}</includeonly><noinclude>Yellow butterfly</noinclude>'|no html}}}}{{#vardefine:leftname|{{#cargo_query:|tables=nh_bug|fields=name|where=nh_bug.number='{{#ifeq:{{PAGENAME}}|Common butterfly|80|{{#expr:{{#var:number}}-1}}}}'|no html}}}}{{#vardefine:rightname|{{#cargo_query:|tables=nh_bug|fields=name|where=nh_bug.number='{{#ifeq:{{PAGENAME}}|Scorpion|1|{{#expr:{{#var:number}}+1}}}}'|no html}}}}
 
{{Header Box
 
{{Header Box
 
|bg-color        = #e4f6bc
 
|bg-color        = #e4f6bc

Revision as of 19:00, January 29, 2023

Template documentation (view)


Notes

This template is for use only on New Horizons bug pages and will not function properly elsewhere. It automatically generates the previous and last bug in the series based on that bug's internal number, as sourced from its Cargo data. It uses {{PAGENAME}} as input, so the bug's name as stored in Cargo must exactly match its article name for proper functionality.

See also