Jump to content

Template:Chess viewer/doc

From Wikipedia, the free encyclopedia

This template allows showing chess games with arrows to allow the viewer to move through the game. It is similar to {{Chess diagram}} except it allows showing the entire game

Usage

[edit]

{{Chess viewer|pgn=PGN HERE}}

The syntax is the same at {{Chess diagram}} with the addition of a ply= to determine the starting ply number and animate= argument to disable animations. There is also show_move=true to add the current move to the caption.

Example

[edit]

{{Chess viewer|align=none|pgn=1. d4 Nf6 2. Nf3 d5 3. g3 e6 4. Bg2 Be7 5. O-O O-O 6. b3 c5 7. dxc5 Bxc5 8. c4 dxc4 9. Qc2 Qe7 10. Nbd2 Nc6 11. Nxc4 b5 12. Nce5 Nb4 13. Qb2 Bb7 14. a3 Nc6 15. Nd3 Bb6 16. Bg5 Rfd8 17. Bxf6 gxf6 18. Rac1 Nd4 19. Nxd4 Bxd4 20. Qa2 Bxg2 21. Kxg2 Qb7+ 22. Kg1 Qe4 23. Qc2 a5 24. Rfd1 Kg7 25. Rd2 Rac8 26. Qxc8 Rxc8 27. Rxc8 Qd5 28. b4 a4 29. e3 Be5 30. h4 h5 31. Kh2 Bb2 32. Rc5 Qd6 33. Rd1 Bxa3 34. Rxb5 Qd7 35. Rc5 e5 36. Rc2 Qd5 37. Rdd2 Qb3 38. Ra2 e4 39. Nc5 Qxb4 40. Nxe4 Qb3 41. Rac2 Bf8 42. Nc5 Qb5 43. Nd3 a3 44. Nf4 Qa5 45. Ra2 Bb4 46. Rd3 Kh6 47. Rd1 Qa4 48. Rda1 Bd6 49. Kg1 Qb3 50. Ne2 Qd3}} produces:

abcdefgh
8
white rook
white pawn
black bishop
black pawn
white pawn
black pawn
black rook
white queen
black pawn
white pawn
white bishop
white pawn
white bishop
black bishop
white pawn
white pawn
white knight
black knight
black king
white rook
black pawn
white pawn
black knight
white knight
white king
black pawn
black pawn
black pawn
black queen
black rook
white pawn
black pawn
8
77
66
55
44
33
22
11
abcdefgh
 

Arguments

[edit]

Display a chess game

Template parameters

This template prefers block formatting of parameters.

ParameterDescriptionTypeStatus
stylestyle

Type of game to show

Suggested values
Chess Chu shogi Dou Shou Qi Eurojanggi Hiashatar Makruk
Default
Chess
Stringoptional
reversereverse

Show from black's view

Booleanoptional
lettersletters

Show letters

Suggested values
top bottom both
Default
both
Stringoptional
numbersnumbers

Show numbers

Suggested values
left right both
Default
both
Stringoptional
pgnpgn

Game in PGN format

Stringrequired
headerheader 2

Wikitext to add as a header

Contentoptional
footerfooter

Wikitext to add as a footer

Contentoptional
alignalign 1

Extra css class

Suggested values
floatright floatleft
Default
floatright
Stringoptional
clearclear

Stop other floated content from floating past

Suggested values
left right
Stringoptional
plyply

Which move (ply) to start the board at

Default
1
Numbersuggested
sizesize

no description

Default
26
Numberoptional
animateanimate

Animate moving of chess pieces

Default
true
Booleanoptional
colorcolor

Color scheme for the chess board. From images in Commons:Category:Chessboard480.

Suggested values
emerald olivine pearl ruby steel tourmaline wood
Stringoptional
show_moveshow_move

Show the current move in algebraic notation in the caption

Booleanoptional
initial_captioninitial_caption

When using show_move=true, this will override the move text in the initial state of the board before the user interacts with it. After the first interaction this initial_caption is removed to show the current move. This can be used if you want to highlight something about the current position that wouldn't make sense after the user moved to a new position. Compare to footer= which is always shown. Must contain only plain text.

Stringoptional