The HTML file board.html
implements the basic board widget for showing games and positions in web pages and blogs, without any html coding for each game, where the chessboard widget is created using a given HTML code within the web page or blog.
The games and display options are assigned from the following URL parameters (the latest parameter list is also available browsing to board.html?help=true):
URL parameters can be shortened: for example squareSize => sq, autoplayMode => am, highlightMoveColorHex => hmch
Also supplied textual values can be shortened: true => t, false => f
Every color parameter can by assigned also by name (like 'red') or using a proprietary encoding in base 64. For instance, the light square color, besides using the lightColorHex parameter can be also assigned using the lightColorName or the lightColorSex parameter. The latter is proprietary and used by the board generator tool.
Caveats:
#
%
&
?
. Those characters, if present in the PGN text should be replaced with their escape sequence: #
=> %23
, %
=> %25
, &
=> %26
and ?
=> %3F
. See here for more details on URL characters. Even better to use the board generator tool to fully encode the PGN data and avoid this issue entirely. Integration with third party software:
pgn-encoder.js
and pgn-encoder.php
contains javascript and php code to generate the encodedPgn parameter form the PGN input. Using the encodedPgn parameter rather than the pgnText parameter for the board widget URL improves robustness and compatibility with web servers and browsers. Below is a well known Spassky-Fischer game from the 1972 world championship, you can use the <iframe>
HTML tag to show it in your web page or blog.
Below you have the (very long) link to add this chessboard to your web page using an <iframe>
HTML tag (make sure you have everything on the same line). In order to help you sizing the iframe, adding the showHeightWidth=true parameter to the URL will prompt with the board dimensions.
When entering the iframe code in your website or blog, please make sure you are using the HTML editing option, otherwise the enhanced editor might alter the code you enter.
<iframe height='720' width='600' frameborder='0' scrolling='no' marginheight='0' marginwidth='0' src='http://pgn4web-board.casaschi.net/? delay=1000& pieceFont=uscf& pieceSize=40& squareSize=50& lightColorHex=E5E1C6& darkColorHex=CCCBAC& highlightMode=border& highlightColorHex=FFFF00& highlightMoveColorHex=F5F587& headerDisplay=centered& movesDisplay=figurine& fontHeaderSize=80pct& fontMovesSize=80pct& fontCommentsSize=80pct& frameHeight=700& frameWidth=600& pgnText=[White "Spassky, Boris"] [Black "Fischer, Robert"] [Result "0-1"] [Date "1972"] [Event "World Championship"] [Site "Reykjavik"] [Round "13"] 1. e4 Nf6 2.e5 Nd5 3. d4 d6 4. Nf3 g6 5. Bc4 Nb6 6. Bb3 Bg7 7. Nbd2 O-O 8. h3 a5 9. a4 dxe5 10. dxe5 Na6 11. O-O Nc5 12. Qe2 Qe8 13. Ne4 Nbxa4 14. Bxa4 Nxa4 15. Re1 Nb6 16. Bd2 a4 17. Bg5 h6 18. Bh4 Bf5 19. g4 Be6 20. Nd4 Bc4 21. Qd2 Qd7 22. Rad1 Rfe8 23. f4 Bd5 24. Nc5 Qc8 25. Qc3 e6 26. Kh2 Nd7 27. Nd3 c5 28. Nb5 Qc6 29. Nd6 Qxd6 30. exd6 Bxc3 31. bxc3 f6 32. g5 hxg5 33. fxg5 f5 34. Bg3 Kf7 35. Ne5+ Nxe5 36. Bxe5 b5 37. Rf1 Rh8 38. Bf6 a3 39. Rf4 a2 40. c4 Bxc4 41. d7 Bd5 42. Kg3 Ra3+ 43. c3 Rha8 44. Rh4 e5 45. Rh7+ Ke6 46. Re7+ Kd6 47. Rxe5 Rxc3+ 48. Kf2 Rc2+ 49. Ke1 Kxd7 50. Rexd5+ Kc6 51. Rd6+ Kb7 52. Rd7+ Ka6 53. R7d2 Rxd2 54. Kxd2 b4 55. h4 Kb5 56. h5 c4 57. Ra1 gxh5 58. g6 h4 59. g7 h3 60. Be7 Rg8 61. Bf8 h2 62. Kc2 Kc6 63. Rd1 b3+ 64. Kc3 h1Q 65. Rxh1 Kd5 66. Kb2 f4 67. Rd1+ Ke4 68. Rc1 Kd3 69. Rd1+ Ke2 70. Rc1 f3 71. Bc5 Rxg7 72. Rxc4 Rd7 73. Re4+ Kf1 74. Bd4 f2 0-1' > your web browser and/or your host do not support iframes as required to display the chessboard </iframe>
Before using this online service please read the service availability disclaimer note.
Wiki: BoardWidget_generator
Wiki: BoardWidget_live
Wiki: BoardWidget_summary
Wiki: Features_Limitations_Bugs
Wiki: Index
Wiki: Live_Broadcast
Wiki: ServiceAvailability
Wiki: User_Notes_Web_Platforms
Wiki: User_Notes_drupal
Wiki: User_Notes_joomla
Wiki: User_Notes_phpBB
Wiki: User_Notes_simplemachines
Wiki: User_Notes_vbulletin
Wiki: User_Notes_wordpress
View and moderate all "wiki Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Wiki"
Originally posted by: paolocas...@gmail.com
When using the board widget for an iFrame as in the example above, the character
'
is used to delimit the url property of the iFrame, therefore any'
character within the pgnText parameter will be misinterpreted as the end of the iFrame url property and the chessboard won't be displayed as intended.In this case, please avoid
'
characters within the pgnText parameter, or replace them with the escape sequence%27
.Last edit: Anonymous 2016-09-06