How to configure the chess game viewer?

This post explains how you can adapt your template in order to use the Chess Game Viewer, but first configure and try the FEN-viewer.

If the FEN-viewer is working fine we start to configure the chess game viewer.
Go to Layout » Edit html
and make a backup of your template

Then find something like

We are going to add some lines above and below this, but also adding an onLoad statement to the body tag.
#pc1 {position:absolute; visibility:hidden; cursor:hand;}
.qzs {position:relative; visibility:hidden;}

<body onLoad='InitSys();'>
<div id='pc1' onClick='DropPc(cg)'>
<img name='dpc'
And (after saving your template) the configuration part is finished.

Let's try it by adding the following code to a post.
<SCRIPT language='JavaScript' 
Game('rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR 1',
'1.e4 e5 2.Qh5 Nc6 3.Bc4 Nf6 4.Qxf7# 1-0',

This is the Scholar's Mate.

The arguments for the Game function are similar to the Fen2Page function. At the moment we still have to add the coded moves (that can be copied from the file generated by Palview). The last optional argument indicates the initial position that has to be shown, because the starting position of the chess board isn't very informative.

  • Once again I was successful after a few tries. Thanks for these tips again.

    P.S. Maybe you could just upload the last version of this html template somewhere so other blogger users can easily download and use it with a few clicks.

  • This sounds like a good idea, but I don't feel that I can distribute the theme I currently use. I'll have to think about writing some dedicated chess themes.

  • Hi Chess Teacher! Finally, I managed to configure the FEN and PAL Viewer on my blog.Take a look.Thanks for guiding us.
    n.b :

  • "file generated by PALView"? what do you mean by those phrases? how do we generate the files? Could we?

  • Palview can be downloaded at this page.
    In the future my intention is to make it unnecessary to add these coded moves, but adding them will speed up the page loading time.

  • After downloading the PALViewm files, What should i do with those downloaded files? Then, how do i generate the needed code to publish game(s) on the blog?

  • There is a manual and a lot of examples at the palview pages, but if you drop a PGN file on palview4.exe a html file will be generated that contains the code in the gm var.

    var gm=['Coded_Moves'];

  • Thank you very much Chess Teacher..I'm on my way downloading the palview4 and trying to make use of Palmate as well.It becomes more and more interesting like this way.Again, thx for revealing the secret of the code!

  • ok Chess Teacher, I managed to get the code generated by PALViewer.Thanks again,next I'll post the sample games which contains the generated code on my blog.See you again..!

  • 2 days searching a simple way to publish chessgames, and i found yours, hopefully....
    simple and effective, thanks!

  • it works... but only with your game Scholar's Mate... how to publish a different game??

    for exemple i changed to :

    < SCRIPT language='JavaScript'
    type='text/javascript' >
    Game('rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR 1',
    '1.d4 d5',
    1,1);< /SCRIPT >
    and i still have your game played on the board...

  • @Tom-R

    You also have to change the coded moves. The easiest way to get these coded moves is by means of the Palview program as mentioned above.

    In your (1.d4 d5) case they are: 'rb@@JZ@@'

  • palview is not working for me :-( .... another way to get the coded moves?

  • @Tom-R

    It's a lot of work to code the moves without a computer program.

    As soon as I have some free time I'm going to create a new version of the Game Viewer in which the coded moves aren't necessary anymore, and only useful for page loading time improvements.
    However I don't expect to finish this within the next months.

  • A first version of the Game Viewer in which the coded moves aren't necessary anymore has been published today.

  • Hi there. I have a blog on, where I write about Team Viking, the only financially sponsored chess team in Sweden. I would like to publish games together with comments and variations. I do have some programming experience. I tried to configure the FEN viewer exactly according to instructions, but when making a test entry, also according to instructions, it just gives an empty page. I followed, I am grateful if you help me out, we would benefit a lot from being able to use your viewer. Kind regards.

  • Can you give me the link of your test posting?

  • Suddenly it worked. I wrote a new test entry, but first I removed the newline before script's closing tag. I don't know much about java scripts in html, so this was a silly mistake by me, I will continue and try to set up everything to work! Here is the link.

  • I think I made everything work now. It looks great! I wrote a post to refer to your site. Please see for a game that I published. There is one thing I couldn't do, and that is to move back and forth in the game using the keyboard strokes "left" and "right". I also tried "space" and several other keys :) Do you have such a feature implemented?

  • Thanks for your post about this site.

    At the moment I don't have keyboard support implemented, but I will probably add it in the next release.

    Your annotated game looks very nice.

  • Thanks for your efforts in bringing out a very useful tool to publish chess games. I have used the chess game viewer in my blog and I have added a link to your site below. Thanks again

  • Hi,thanks for the post.
    I have the viewer implemented in my blog . the only thin i dont know is how to generate the codes for the games. ¿
    How should I go about it?

  • I suggest to use Palview to generate the coded moves, but it's also possible to use the Game viewer without the coded moves. See