This is a documentation for Board Game Arena: play board games online !

Template:Chessboard: Difference between revisions

From Board Game Arena
Jump to navigation Jump to search
(Simplified & added optional highlight squares)
m (parameters section)
Line 115: Line 115:
|}
|}
<noinclude>
<noinclude>
Simply copy & paste the chessboard template below into a BGA wiki page.
To insert this chessboard template into a BGA wiki page, simply type <code><nowiki>{{chessboard}}</nowiki></code> when editing the page, or alternatively copy one of the examples below.


Game Help pages (e.g. '[[Gamehelpchess|GameHelpChess]]') also display on BGA's Rules Summary pages
'''Note:''' Game Help pages (e.g. '[[Gamehelpchess|GameHelpChess]]') also display on BGA's Rules Summary pages
e.g. https://boardgamearena.com/gamepanel?game=chess under HOW TO PLAY? > See More > RULES SUMMARY


e.g. https://boardgamearena.com/gamepanel?game=chess under HOW TO PLAY? > See More > RULES SUMMARY
Empty board template:
<pre>
<pre>
{{chessboard | maxWidth=400px | numbersColumnWidth=20px | squareSize=45px | lightSquareColour=#fff | darkSquareColour=#ddd
{{chessboard
| a8= | b8= | c8= | d8= | e8= | f8= | g8= | h8=  
| a8= | b8= | c8= | d8= | e8= | f8= | g8= | h8=  
| a7= | b7= | c7= | d7= | e7= | f7= | g7= | h7=  
| a7= | b7= | c7= | d7= | e7= | f7= | g7= | h7=  
Line 132: Line 133:
}}
}}
</pre>
</pre>
The default parameter values are as shown:
 
{|  
{| style="vertical-align: top; text-align: left;"
| style="vertical-align: top;"| <code>maxWidth=400px</code>
! Parameter !! Default value !! Example !! Description
|-
|- style="vertical-align: top; text-align: left;"
| style="vertical-align: top;"| <code>numbersColumnWidth=20px</code>
| <code>maxWidth</code>
|-
| <code>400px</code>
| style="vertical-align: top;"| <code>squareSize=45px</code>
| <code><nowiki>{{chessboard | maxWidth=500px}}</nowiki></code>
|| 45px is the minimum square size
| <i>optional:</i> specify the maximum width of the chessboard
|-
|- style="vertical-align: top; text-align: left;"
| style="vertical-align: top;"| <code>lightSquareColour=#fff</code>
| <code>numbersColumnWidth</code>
|| white
| <code>20px</code>
|-
| <code><nowiki>{{chessboard | numbersColumnWidth=30px}}</nowiki></code>
| style="vertical-align: top;"| <code>darkSquareColour=#ddd</code>
| <i>optional:</i> specify the width of the side columns
|| light grey
|- style="vertical-align: top; text-align: left;"
|-
| <code>squareSize</code>
| style="vertical-align: top;"| <code>highlighta8=</code>
| <code>45px</code>
|| optionally highlight any square using: <code>highlight</code><code>[file]</code><code>[rank]</code><code>=</code><code><nowiki>{{redSquare}}</nowiki></code> or <code><nowiki>{{greenSquare}}</nowiki></code> or <code><nowiki>{{blueSquare}}</nowiki></code>
| <code><nowiki>{{chessboard | squareSize=50px}}</nowiki></code>
| <i>optional:</i> specify the square dimensions - 45px minimum
|- style="vertical-align: top; text-align: left;"
| <code>lightSquareColour</code>
| <code>#fff</code>
| <code><nowiki>{{chessboard | lightSquareColour=#fee}}</nowiki></code>
| <i>optional:</i> specify the light square colour
|- style="vertical-align: top; text-align: left;"
| <code>darkSquareColour</code>
| <code>#ddd</code>
| <code><nowiki>{{chessboard | darkSquareColour=#dcc}}</nowiki></code>
| <i>optional:</i> specify the dark square colour
|- style="vertical-align: top; text-align: left;"
| <code>a8</code>
| <code>null</code>
| <code><nowiki>{{chessboard | a8={{blackRook}}}}</nowiki></code>
| <i>optional:</i> place an image in any square using:
<code><b>[letter][digit]</b>=<nowiki>[[</nowiki>File:<b>ImageFileName</b>|<b>Image Tooltip</b><nowiki>]]</nowiki></code> or <code><nowiki>{{</nowiki><b>templateName</b><nowiki>}}</nowiki></code>
 
<b>[[Special:Upload|Upload your game piece image here]]</b>
|- style="vertical-align: top; text-align: left;"
| <code>highlighta8</code>
| <code><nowiki>{{emptySquare}}</nowiki></code>
| <code><nowiki>{{chessboard | highlighta8={{redSquare}}}}</nowiki></code>
| <i>optional:</i> highlight any square using:
<code>highlight<b>[letter][digit]</b>=<nowiki>{{redSquare}}</nowiki></code> or <code><nowiki>{{greenSquare}}</nowiki></code> or <code><nowiki>{{blueSquare}}</nowiki></code>
|}
|}



Revision as of 20:46, 6 December 2021

Basic empty chessboard

A B C D E F G H
8
Empty Square
Empty Square
Empty Square
Empty Square
Empty Square
Empty Square
Empty Square
Empty Square
Empty Square
Empty Square
Empty Square
Empty Square
Empty Square
Empty Square
Empty Square
Empty Square
8
7
Empty Square
Empty Square
Empty Square
Empty Square
Empty Square
Empty Square
Empty Square
Empty Square
Empty Square
Empty Square
Empty Square
Empty Square
Empty Square
Empty Square
Empty Square
Empty Square
7
6
Empty Square
Empty Square
Empty Square
Empty Square
Empty Square
Empty Square
Empty Square
Empty Square
Empty Square
Empty Square
Empty Square
Empty Square
Empty Square
Empty Square
Empty Square
Empty Square
6
5
Empty Square
Empty Square
Empty Square
Empty Square
Empty Square
Empty Square
Empty Square
Empty Square
Empty Square
Empty Square
Empty Square
Empty Square
Empty Square
Empty Square
Empty Square
Empty Square
5
4
Empty Square
Empty Square
Empty Square
Empty Square
Empty Square
Empty Square
Empty Square
Empty Square
Empty Square
Empty Square
Empty Square
Empty Square
Empty Square
Empty Square
Empty Square
Empty Square
4
3
Empty Square
Empty Square
Empty Square
Empty Square
Empty Square
Empty Square
Empty Square
Empty Square
Empty Square
Empty Square
Empty Square
Empty Square
Empty Square
Empty Square
Empty Square
Empty Square
3
2
Empty Square
Empty Square
Empty Square
Empty Square
Empty Square
Empty Square
Empty Square
Empty Square
Empty Square
Empty Square
Empty Square
Empty Square
Empty Square
Empty Square
Empty Square
Empty Square
2
1
Empty Square
Empty Square
Empty Square
Empty Square
Empty Square
Empty Square
Empty Square
Empty Square
Empty Square
Empty Square
Empty Square
Empty Square
Empty Square
Empty Square
Empty Square
Empty Square
1
A B C D E F G H

To insert this chessboard template into a BGA wiki page, simply type {{chessboard}} when editing the page, or alternatively copy one of the examples below.

Note: Game Help pages (e.g. 'GameHelpChess') also display on BGA's Rules Summary pages e.g. https://boardgamearena.com/gamepanel?game=chess under HOW TO PLAY? > See More > RULES SUMMARY

Empty board template:

{{chessboard
| a8= | b8= | c8= | d8= | e8= | f8= | g8= | h8= 
| a7= | b7= | c7= | d7= | e7= | f7= | g7= | h7= 
| a6= | b6= | c6= | d6= | e6= | f6= | g6= | h6= 
| a5= | b5= | c5= | d5= | e5= | f5= | g5= | h5= 
| a4= | b4= | c4= | d4= | e4= | f4= | g4= | h4= 
| a3= | b3= | c3= | d3= | e3= | f3= | g3= | h3= 
| a2= | b2= | c2= | d2= | e2= | f2= | g2= | h2= 
| a1= | b1= | c1= | d1= | e1= | f1= | g1= | h1= 
}}
Parameter Default value Example Description
maxWidth 400px {{chessboard | maxWidth=500px}} optional: specify the maximum width of the chessboard
numbersColumnWidth 20px {{chessboard | numbersColumnWidth=30px}} optional: specify the width of the side columns
squareSize 45px {{chessboard | squareSize=50px}} optional: specify the square dimensions - 45px minimum
lightSquareColour #fff {{chessboard | lightSquareColour=#fee}} optional: specify the light square colour
darkSquareColour #ddd {{chessboard | darkSquareColour=#dcc}} optional: specify the dark square colour
a8 null {{chessboard | a8={{blackRook}}}} optional: place an image in any square using:

[letter][digit]=[[File:ImageFileName|Image Tooltip]] or {{templateName}}

Upload your game piece image here

highlighta8 {{emptySquare}} {{chessboard | highlighta8={{redSquare}}}} optional: highlight any square using:

highlight[letter][digit]={{redSquare}} or {{greenSquare}} or {{blueSquare}}

Chess starting position

A B C D E F G H
8
Rook
Empty Square
Knight
Empty Square
Bishop
Empty Square
Queen
Empty Square
King
Empty Square
Bishop
Empty Square
Knight
Empty Square
Rook
Empty Square
8
7
Pawn
Empty Square
Pawn
Empty Square
Pawn
Empty Square
Pawn
Empty Square
Pawn
Empty Square
Pawn
Empty Square
Pawn
Empty Square
Pawn
Empty Square
7
6
Empty Square
Empty Square
Empty Square
Empty Square
Empty Square
Empty Square
Empty Square
Empty Square
6
5
Empty Square
Empty Square
Empty Square
Empty Square
Empty Square
Empty Square
Empty Square
Empty Square
5
4
Empty Square
Empty Square
Empty Square
Empty Square
Empty Square
Empty Square
Empty Square
Empty Square
4
3
Empty Square
Empty Square
Empty Square
Empty Square
Empty Square
Empty Square
Empty Square
Empty Square
3
2
Pawn
Empty Square
Pawn
Empty Square
Pawn
Empty Square
Pawn
Empty Square
Pawn
Empty Square
Pawn
Empty Square
Pawn
Empty Square
Pawn
Empty Square
2
1
Rook
Empty Square
Knight
Empty Square
Bishop
Empty Square
Queen
Empty Square
King
Empty Square
Bishop
Empty Square
Knight
Empty Square
Rook
Empty Square
1
A B C D E F G H
{{chessboard | lightSquareColour=#efe | darkSquareColour=#cdc
| a8={{blackRook}}  | b8={{blackKnight}}| c8={{blackBishop}}| d8={{blackQueen}} | e8={{blackKing}}  | f8={{blackBishop}}| g8={{blackKnight}}| h8={{blackRook}}
| a7={{blackPawn}}  | b7={{blackPawn}}  | c7={{blackPawn}}  | d7={{blackPawn}}  | e7={{blackPawn}}  | f7={{blackPawn}}  | g7={{blackPawn}}  | h7={{blackPawn}}
| a6=               | b6=               | c6=               | d6=               | e6=               | f6=               | g6=               | h6=               
| a5=               | b5=               | c5=               | d5=               | e5=               | f5=               | g5=               | h5=               
| a4=               | b4=               | c4=               | d4=               | e4=               | f4=               | g4=               | h4=               
| a3=               | b3=               | c3=               | d3=               | e3=               | f3=               | g3=               | h3=               
| a2={{whitePawn}}  | b2={{whitePawn}}  | c2={{whitePawn}}  | d2={{whitePawn}}  | e2={{whitePawn}}  | f2={{whitePawn}}  | g2={{whitePawn}}  | h2={{whitePawn}}
| a1={{whiteRook}}  | b1={{whiteKnight}}| c1={{whiteBishop}}| d1={{whiteQueen}} | e1={{whiteKing}}  | f1={{whiteBishop}}| g1={{whiteKnight}}| h1={{whiteRook}}
}}