Difference between revisions of "Template:Song Header"

From Nookipedia, the Animal Crossing wiki
(Created page with "{{#vardefine:number|{{#cargo_query:|tables=song|fields=order_number|where=song._pageTitle='<includeonly>{{PAGENAME}}</includeonly><noinclude>K.K. March</noinclude>'|no html}}}...")
Tags: mobile edit mobile web edit
 
(adding Hazure songs to header)
(10 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{#vardefine:number|{{#cargo_query:|tables=song|fields=order_number|where=song._pageTitle='<includeonly>{{PAGENAME}}</includeonly><noinclude>K.K. March</noinclude>'|no html}}}}{{#vardefine:leftname|{{#cargo_query:|tables=song|fields=name|where=song.order_number='{{#ifeq:{{PAGENAME}}|K.K. Chorale|95|{{#expr:{{#var:number}}-1}}}}'|no html}}}}{{#vardefine:rightname|{{#cargo_query:|tables=song|fields=name|where=song.order_number='{{#ifeq:{{PAGENAME}}|Welcome Horizons|1|{{#expr:{{#var:number}}+1}}}}'|no html}}}}
+
{{#vardefine:number|{{#cargo_query:|tables=song|fields=order_number|where=song._pageTitle="<includeonly>{{PAGENAME}}</includeonly><noinclude>K.K. March</noinclude>"|no html}}}}{{#vardefine:leftname|{{#cargo_query:|tables=song|fields=name|where=song.order_number="{{#switch:{{PAGENAME}}|K.K. Chorale=903|Hazure01=107|#default={{#expr:{{#var:number}}-1}}}}"|no html}}}}{{#vardefine:rightname|{{#cargo_query:|tables=song|fields=name|where=song.order_number="{{#switch:{{PAGENAME}}|K.K. Robot Synth=901|Hazure03=1|#default={{#expr:{{#var:number}}+1}}}}"|no html}}}}
 
{{Header Box
 
{{Header Box
 
|bg-color        = #EEC2C1
 
|bg-color        = #EEC2C1
 
|cell-border    = #DF8584
 
|cell-border    = #DF8584
|left-link      = {{#cargo_query:|tables=song|fields=_pageTitle|where=song.order_number='{{#ifeq:{{PAGENAME}}|K.K. Chorale|95|{{#expr:{{#var:number}}-1}}}}'|no html}}
+
|left-link      = {{#cargo_query:|tables=song|fields=_pageTitle|where=song.order_number="{{#switch:{{PAGENAME}}|K.K. Chorale=903|Hazure01=107|#default={{#expr:{{#var:number}}-1}}}}"|no html}}
|left-text      = ('''{{#cargo_query:|tables=song|fields=order_number|where=song.name='{{#var:leftname}}'|no html}}''') {{#var:leftname}}
+
|left-text      = ('''{{#cargo_query:|tables=song|fields=order_number|where=song.name="{{#var:leftname}}"|no html}}''') {{#var:leftname}}
 
|middle-link    = List of K.K. Slider songs
 
|middle-link    = List of K.K. Slider songs
 
|middle-text    = K.K. Slider songs
 
|middle-text    = K.K. Slider songs
|right-link      = {{#cargo_query:|tables=song|fields=_pageTitle|where=song.order_number='{{#ifeq:{{PAGENAME}}|Welcome Horizons|1|{{#expr:{{#var:number}}+1}}}}'|no html}}
+
|right-link      = {{#cargo_query:|tables=song|fields=_pageTitle|where=song.order_number="{{#switch:{{PAGENAME}}|K.K. Robot Synth=901|Hazure03=1|#default={{#expr:{{#var:number}}+1}}}}"|no html}}
|right-text      = {{#var:rightname}} ('''{{#cargo_query:|tables=song|fields=order_number|where=song.name='{{#var:rightname}}'|no html}}''')
+
|right-text      = {{#var:rightname}} ('''{{#cargo_query:|tables=song|fields=order_number|where=song.name="{{#var:rightname}}"|no html}}''')
|left-image      = File:{{#cargo_query:|tables=song|fields=image|where=song.order_number='{{#ifeq:{{PAGENAME}}|K.K. Chorale|95|{{#expr:{{#var:number}}-1}}}}'|no html}}
+
|left-image      = File:{{#switch:{{PAGENAME}}|Hazure02|Hazure03|K.K. Chorale=Aircheck NH Inv Icon.png|#default={{#cargo_query:|tables=song|fields=image|where=song.order_number="{{#switch:{{PAGENAME}}|K.K. Chorale=903|Hazure01=107|#default={{#expr:{{#var:number}}-1}}}}"|no html}}}}
|left-imagesize  = 50px
+
|left-imagesize  = 35px
|right-image    = File:{{#cargo_query:|tables=song|fields=image|where=song.order_number='{{#ifeq:{{PAGENAME}}|Welcome Horizons|1|{{#expr:{{#var:number}}+1}}}}'|no html}}
+
|right-image    = File:{{#switch:{{PAGENAME}}|K.K. Robot Synth|Hazure01|Hazure02=Aircheck NH Inv Icon.png|#default={{#cargo_query:|tables=song|fields=image|where=song.order_number="{{#switch:{{PAGENAME}}|K.K. Robot Synth=901|Hazure03=1|#default={{#expr:{{#var:number}}+1}}}}"|no html}}}}
|right-imagesize = 50px
+
|right-imagesize = 35px
 
}}<noinclude>{{Documentation}} [[Category:Header templates]]</noinclude>
 
}}<noinclude>{{Documentation}} [[Category:Header templates]]</noinclude>

Revision as of 19:34, September 3, 2022

Template documentation (view)


Notes

This template is for use on K.K. Slider song pages, and sorts them by the song order. The order, name and images are sourced from Cargo data and as such must match properly.

See also