• Welcome to Touhou Wiki!
  • Registering is temporarily disabled. Check in our Discord server to request an account and for assistance of any kind.

Module talk:Navbox: Difference between revisions

From Touhou Wiki
Jump to navigation Jump to search
(it works! :D)
 
mNo edit summary
(8 intermediate revisions by the same user not shown)
Line 1: Line 1:
== Practical usage ==
{{#invoke:Navbox|buildNavbox|type=game
|name      = Navbox EoSD
|title      = [[Embodiment of Scarlet Devil]]
|image      = [[File:Th06cover.jpg|175px]]
|group1    = [[Embodiment of Scarlet Devil/Story|Story]]
|list1      = {{#invoke:Navbox|buildNavbox|child|type=game
  |evenodd = swap
  |groupwidth = 10em
  |group1 = Main Scenario
  |list1  = [[Embodiment of Scarlet Devil/Story/Prologue|Prologue]] —  [[Embodiment of Scarlet Devil/Story/Reimu's Scenario|Reimu]] • [[Embodiment of Scarlet Devil/Story/Marisa's Scenario|Marisa]]
  |group2 = Extra Scenario
  |list2  = [[Embodiment of Scarlet Devil/Story/Extra Story|Extra Story]] — [[Embodiment of Scarlet Devil/Story/Reimu's Extra|Reimu]] • [[Embodiment of Scarlet Devil/Story/Marisa's Extra|Marisa]]
  |group3 = [[Embodiment of Scarlet Devil/Characters|Characters]]
  |list3  = [[Reimu Hakurei]] • [[Marisa Kirisame]] • [[Rumia]] • [[Daiyousei]] • [[Cirno]] • [[Hong Meiling]] • [[Koakuma]] • [[Patchouli Knowledge]] • [[Sakuya Izayoi]] • [[Remilia Scarlet]] • [[Flandre Scarlet]] • ([[Rin Satsuki]])
  |group4 = Locations
  |list4  = [[Misty Lake]] • [[Scarlet Devil Mansion]]
  |group5 = Terms
  |list5  = [[Vampire]]
}}
|group2    = [[Embodiment of Scarlet Devil/Gameplay|Gameplay]]
|list2      = {{#invoke:Navbox|buildNavbox|child|type=game
  |groupwidth = 10em
  |group1 =  
  |list1  = [[Embodiment of Scarlet Devil/Strategy|Strategy]] ([[:Category:Embodiment of Scarlet Devil Replays|Replays]]) • [[High scores#Embodiment of Scarlet Devil world records (東方風神録の全一記録)|High Scores]]
  |group2 = [[Embodiment of Scarlet Devil/Spell Cards|Spell Cards]]
  |list2  = [[Embodiment of Scarlet Devil/Spell Cards/Stage 1|Stage 1]] • [[Embodiment of Scarlet Devil/Spell Cards/Stage 2|Stage 2]] • [[Embodiment of Scarlet Devil/Spell Cards/Stage 3|Stage 3]] • [[Embodiment of Scarlet Devil/Spell Cards/Stage 4|Stage 4]] • [[Embodiment of Scarlet Devil/Spell Cards/Stage 5|Stage 5]] • [[Embodiment of Scarlet Devil/Spell Cards/Stage 6|Stage 6]] • [[Embodiment of Scarlet Devil/Spell Cards/Extra|Extra]]
}}
|group3    = Mechanics
|list3      = [[Embodiment of Scarlet Devil/Gameplay|Gameplay]] • [[Embodiment of Scarlet Devil/Strategy|Strategy]] • [[High_scores#Embodiment of Scarlet Devil world records (東方紅魔郷の全一記録)|High Scores]] • [[:Category:Embodiment of Scarlet Devil Replays|Replays]]
|group4    = Documentation
|list4      = [[Embodiment of Scarlet Devil/Afterword|Afterword]] • [[Embodiment of Scarlet Devil/Music|Music Comments]] • [[Embodiment of Scarlet Devil/Translation|Other Translations]] • [[Embodiment of Scarlet Devil/English patch|English Patch]]
}}
== Test cases ==
== Test cases ==
Set of basic test cases, to check if the whole functionality of original navbox works.
Set of basic test cases, to check if the whole functionality of original navbox works.


The optional parameter ''type'' was introduced in Polish version of [[:pl:Szablon:Navbox|Navbox]]. When it's not specified, the style of navbox is the basic style defined by main CSS.
The optional parameter ''type'' was introduced in Polish version of [[:pl:Szablon:Navbox|Navbox]]. When it's not specified, the style of navbox is the basic style defined by main CSS.
{{#invoke:Navbox|buildColorTable}}
{{#invoke:Navbox|buildNavbox
{{#invoke:Navbox|buildNavbox
|state=plain
|state=plain
|name=Invalid
|name=Invalid
|title=Test navbox, no type
|title=no type or unknown type, state=plain
|image=[[File:GoM_Cover.jpg|140px]]
|image=[[File:GoM_Cover.jpg|140px]]
|above=above1
|above=above1
|group1=Group 1
|group1=Group 1
|list1 =List 1
|list1 =List 1
|group1style=color:#D0FFF6
|list1style=font-weight:bold
|group2=Group 2
|group2=Group 2
|list2 =List 2
|list2 =List 2
|group3=Group 3
|group3=Group 3
|list3 =List 3
|list3 =List 3
|group5=Group 5
|group4=Group 4
|list5 =List 5
|list4 =List 4
|group6=Group 6
|group106=Group 106
|list6 ={{#invoke:Navbox|buildNavbox|child|above=above 6.1
|list106 ={{#invoke:Navbox|buildNavbox|child
   |group1=Group 6.1
  |evenodd=swap
   |list1 =List 6.1
  |above=above 106.1, evenodd=swap
   |group2=Group 6.2
   |group1=Group 106.1
   |list2 =List 6.2
   |list1 =List 106.1
   |below=below 6.1
   |group2=Group 106.2
   |list2 =List 106.2
   |below=below 106.1
}}
}}
|below=below1
|below=below1
Line 33: Line 74:
|state=plain
|state=plain
|name=Invalid
|name=Invalid
|title=Test navbox, type=game
|title= type=game, state=plain
|image=[[File:GoM_Cover.jpg|140px]]
|image=[[File:GoM_Cover.jpg|140px]]
|above=above1
|above=above1
|group1=Group 1
|group1=Group 1
|list1 =List 1
|list1 =List 1
|group1style=color:#D0FFF6
|list1style=font-weight:bold
|group2=Group 2
|group2=Group 2
|list2 =List 2
|list2 =List 2
|group3=Group 3
|group3=Group 3
|list3 =List 3
|list3 =List 3
|group5=Group 5
|group4=Group 4
|list5 =List 5
|list4 =List 4
|group6=Group 6
|group106=Group 106
|list6 ={{#invoke:Navbox|buildNavbox|child|type=game
|list106 ={{#invoke:Navbox|buildNavbox|child|type=game
   |above=above 6.1
  |evenodd=swap
   |group1=Group 6.1
   |above=above 106.1, evenodd=swap
   |list1 =List 6.1
   |group1=Group 106.1
   |group2=Group 6.2
   |list1 =List 106.1
   |list2 =List 6.2
   |group2=Group 106.2
   |below=below 6.1
   |list2 =List 106.2
   |below=below 106.1
}}
}}
|below=below1
|below=below1
Line 61: Line 101:
|state=plain
|state=plain
|name=Invalid
|name=Invalid
|title=Test navbox, type=music
|title= type=music, state=plain
|image=[[File:GoM_Cover.jpg|140px]]
|image=[[File:GoM_Cover.jpg|140px]]
|above=above1
|above=above1
|group1=Group 1
|group1=Group 1
|list1 =List 1
|list1 =List 1
|group1style=color:#D0FFF6
|list1style=font-weight:bold
|group2=Group 2
|group2=Group 2
|list2 =List 2
|list2 =List 2
|group3=Group 3
|group3=Group 3
|list3 =List 3
|list3 =List 3
|group5=Group 5
|group4=Group 4
|list5 =List 5
|list4 =List 4
|group6=Group 6
|group106=Group 106
|list6 ={{#invoke:Navbox|buildNavbox|child|type=music
|list106 ={{#invoke:Navbox|buildNavbox|child|type=music
   |above=above 6.1
  |evenodd=swap
   |group1=Group 6.1
   |above=above 106.1, evenodd=swap
   |list1 =List 6.1
   |group1=Group 106.1
   |group2=Group 6.2
   |list1 =List 106.1
   |list2 =List 6.2
   |group2=Group 106.2
   |below=below 6.1
   |list2 =List 106.2
   |below=below 106.1
}}
}}
|below=below1
|below=below1
Line 89: Line 128:
|state=plain
|state=plain
|name=Invalid
|name=Invalid
|title=Test navbox, type=printwork
|title= type=printwork, state=plain
|image=[[File:GoM_Cover.jpg|140px]]
|image=[[File:GoM_Cover.jpg|140px]]
|above=above1
|above=above1
|group1=Group 1
|group1=Group 1
|list1 =List 1
|list1 =List 1
|group1style=color:#D0FFF6
|list1style=font-weight:bold
|group2=Group 2
|group2=Group 2
|list2 =List 2
|list2 =List 2
|group3=Group 3
|group3=Group 3
|list3 =List 3
|list3 =List 3
|group5=Group 5
|group4=Group 4
|list5 =List 5
|list4 =List 4
|group6=Group 6
|group106=Group 106
|list6 ={{#invoke:Navbox|buildNavbox|child|type=printwork
|list106 ={{#invoke:Navbox|buildNavbox|child|type=printwork
   |above=above 6.1
  |evenodd=swap
   |group1=Group 6.1
   |above=above 106.1, evenodd=swap
   |list1 =List 6.1
   |group1=Group 106.1
   |group2=Group 6.2
   |list1 =List 106.1
   |list2 =List 6.2
   |group2=Group 106.2
   |below=below 6.1
   |list2 =List 106.2
   |below=below 106.1
}}
}}
|below=below1
|below=below1
Line 117: Line 155:
|state=plain
|state=plain
|name=Invalid
|name=Invalid
|title=Test navbox
|title=state=plain
|above=above1
|above=above1
|group1=Group 1
|group1=Group 1
|list1 =List 1
|list1 =List 1
|group6={{#invoke:Navbox|buildNavbox|none
<!-- Without fix, these would collide with arguments without leading zeros lust like passing same argument twice, though these are different names. -->
|group01=Group 01
|list01 =List 01
|group02=Group 02
|list02 =List 02
|group4=Group 4
|list4 =List 4
|group6={{#invoke:Navbox|buildNavbox
   |above=above 6.1
   |above=above 6.1
  |group1=Group 6.1
   |list1 =navbox as group
   |list1 =List 6.1
   |list2 =border undefined
  |group2=Group 6.2
   |list2 =List 6.2
   |below=below 6.1
   |below=below 6.1
}}
}}
|list6 ={{#invoke:Navbox|buildNavbox|child
|list6 ={{#invoke:Navbox|buildNavbox|border=child
   |above=above 6.1
   |above=above 6.1, named parameter border=child
   |group1=Group 6.1
   |group1=Group 6.1
   |list1 =List 6.1
   |list1 =List 6.1
  |group2=Group 6.2
   |list2 =List 6.2, without group
   |list2 =List 6.2
   |below=below 6.1
   |below=below 6.1
}}
}}
|below=below1
|below=Argument names with leading zeros in indexes should be ignored.
}}
}}


{{#invoke:Navbox|buildNavbox
{{#invoke:Navbox|buildNavbox
|state=plain
|name=Invalid
|name=Invalid
|title=Test navbox
|title=Test navbox
Line 148: Line 189:
|list1 =List 1
|list1 =List 1
|group6=Group 6
|group6=Group 6
|list6={{#invoke:Navbox|buildNavbox|type=printwork
|list6={{#invoke:Navbox|buildNavbox|child
  |type=printwork
   |above=above 6.1
   |above=above 6.1
   |group1=Group 6.1
   |group1=Group 6.1
Line 157: Line 199:
}}
}}
|below=below1
|below=below1
}}
{{#invoke:Navbox|buildNavbox|type=printwork
|name=Invalid
|title=Style test, type=printwork; there's no "list1", but images work!
|image=[[File:GoM_Cover.jpg|x140px]]
|imagestyle=border:inset 2px #808080
|imageleft=[[File:Placeholder other.png|x140px|link=|alt=]]
|imageleftstyle=border:outset 2px #808080
|above=Above text
|abovestyle=font-weight:bold
|group1001=Group 1001
|group1001style=background:#ccffcc
|list1001 =List 1001
|list1001style=color:#FF0000
|group1002=Group 1002
|list1002 =List 1002
|list1002style=color:#00FF00
|group1003=Group 1003
|list1003 =List 1003
|list1003style=color:#0000FF
|group1004=Group 1004
|list1004 =List 1004
|group1005=Group 1005
|list1005 =List 1005
|group1006=Group 1006
|list1006 =List 1006
|below=Below text
|belowstyle=font-style:italic
|titlestyle=font-weight:normal;font-style:italic
|groupstyle=background:#ffccff
|evenstyle=text-align:center;background:#ffffcc
|oddstyle=font-weight:bold;background:#ccffff
}}
}}

Revision as of 18:22, 3 October 2012

Practical usage

Test cases

Set of basic test cases, to check if the whole functionality of original navbox works.

The optional parameter type was introduced in Polish version of Navbox. When it's not specified, the style of navbox is the basic style defined by main CSS.

List of colors in order from darkest to brigthest one
"type"titleabove, belowgroup,
sub-above/below
sub-groupdark backgroundbackground
printwork#DDE6FF#E1E7FF#E6E9FF#EAECFF#EDF2FF#F4F9FF
music#FFF3B4#FFF6C0#FFF7C8#FFF8D0#FFFBE4#FFFBEE
game#FFC9C2#FFD1CA#FFD9D2#FFE1DA#FFEEE8#FFF4EE