Summary: Talk page for ChessMarkup.
Maintainer: Pm
Users: (View? / Edit)

This space is for User-contributed commentary and notes. Please include your name and a date along with your comment.


Non-square squares

I find that the squares of the chessboard aren’t square (height is greater than width) unless I modify a style, like so (e.g. in config.php):

 $HTMLStylesFmt['chess'] .= "\n  table.chesstable { line-height: 0; }\n";

Said Achmiz December 31, 2017, at 03:54 PM

(Solved) Bug with queenside castling

The recipe prior to version 2006-12-12 didn't recognize the queenside castling (O-O-O) properly. The bug was reported by Bartolin December 12, 2006, at 03:41 AM.

Now fixed, thanks! Pm December 12, 2006, at 07:42 AM

Problem with (:markup:) and (:chessboard:) directives combined

There may be problems if you use both (:markup:) and (:chessboard:) directives -- the chessboards may not display what you expect to see. I guess, that's because everything within (:markup:) environment is interpreted before the "normal" text of wiki pages (which contains your chess moves in PGN format). So: don't use (:chessboard:) directives within (:markup:). For details compare PITS entry 01064.

Bartolin July 08, 2009, at 04:29 PM

Using (:chessboard:) with captions (titles)

I thought it'd be useful to have an option to give a caption (like "white to move") to a position. As noted above that's easy if one uses the Chessboard:{FEN}?t=.gif syntax: It is possible to style the generated image with a style like %rframe% Chessboard:{FEN}&t=.gif | Board after move n .

Using the (:chessboard:) directive I don't see a simple way to provide a caption which remains stuck to the chessboard however this is aligned or styled. Therefore I hacked the script chess.php on my local machine in the following way:

  1. Add the following line to the definition of the function ChessTable($pagename, $args):
    # line 202:
    $caption = $args['caption'];
  2. Add a <caption> tag to the table which defines the chessboard
    # line 230:
    return "<table $tableargs><caption align=bottom>$caption</caption>".Keep(implode('', $out))."</table>";

That makes it possible to use the following syntax:

(:chessboard caption="Board after move x":)


Hello Pm, I know it's a bit old recipe, but I find it useful. I can change the markup_e for php5.5 by myself, but I am not able to fix the code from preg_replace to preg_replace_callback. If you have a little time, can you fix it? - Thank you.

Frank February 13, 2016, at 22:33 PM

I've updated the recipe, download the zip file and please report if it works. --Petko February 13, 2016, at 05:58 PM

It works well, thank you. --Frank February 14, 2016, at 02:54 AM

Talk page for the ChessMarkup recipe (users?).