Template:Chess/board
This template allows editors to easily insert chessboards showing different positions. Chessboards can be rendered from a moves list (in algebraic notation, i.e. PGN) or a FEN code.
The chessboards are rendered using CSS grids.
Usage
Chess/board needs only a move list in algebraic notation or a FEN to render the board. Moves should go into the moves parameter and a FEN into the fen parameter.
{{Chess/board |moves=1. e4 e5 2. Nf3 Nc6 3. Bb5}}
{{Chess/board |fen=r1bqkbnr/pppp1ppp/2n5/1B2p3/4P3/5N2/PPPP1PPP/RNBQK2R}}
An optional caption can be added with caption.
{{Chess/board |moves=1. e4 e5 2. Nf3 Nc6 3. Bb5| caption=The Spanish opening.}}
Styling
Chess/board supports several options for styling via the following parameters
- frame (boolean) imitates wikicode-style image frames. Default is false.
- float (left, right, inline-start, inline-end, or none) accepts CSS float values to position the chessboard. Default is none.
- size (numeric) sets scale of chessboard. Default is 1. 2 is twice as big, 0.5 is half as big, and so on.
- scheme sets the colour scheme. Currently supported are brown (default) orange, green and bw.
Further options are planned.
{{Chess/board |moves=1. e4 e5 2. Nf3 Nc6 3. Bb5 f5 4. d3 fxe4 5. dxe4 Nf6 6. O-O d6 7. Bc4 Bg4 8. h3 Bh5 9. Nc3 Qd7 10. Be3 Be7 11. a4 Rf8 12. Be2 Bxf3 13. Bxf3 Kf7 14. Nd5 Kg8 15. a5 a6 16. c3 Kh8 17. Qb3 Nd8 18. Rad1 Nxd5 19. Bg4 Qb5 20. Qxd5 Qxb2 21. Qc4 c6 22. Rb1 Qa3 23. Bb6 Nf7 24. Ra1 Qb2 25. Rfb1 d5 |caption=Carlsen vs. Caruana, 2019, position after move 25. |scheme=bw |frame=1 |size=1.5}}
Inserts a chessboard showing different positions from a moves list (in algebraic notation, i.e. PGN) or a FEN code.
Parameter | Description | Type | Status | |
---|---|---|---|---|
moves | moves | A series of moves in algebraic chess notation leading to the position. If neither moves nor fen are set, template will try to interpret a move order from the page title or default to the starting position.
| Unknown | suggested |
fen | fen | Board position in FEN notation
| Unknown | optional |
caption | caption | Description of the position that will appear below the board. | String | optional |
frame | frame | Styles with a wikicode-style image frame.
| Boolean | optional |
float | float | Options for placement of board on page.
| Unknown | optional |
size | size | Set scale of board and caption. Default is 1.
| Number | optional |
scheme | scheme | Sets colour scheme of board squares
| Unknown | optional |