It's better when it's simple

User Tools

Site Tools


Chessdiagram Plugin

Compatible with DokuWiki

Hrun, Detritus, Elenor of Tsort, Greebo

plugin Format a chess board using FEN notation or an alternative 8x8-layout

Last updated on

This extension has not been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues.

Similar to godiag, weiqi

Tagged with chess, diagram, game, images, media


Chessdiagram converts FEN notation or an alternative 8×8-layout to a chess diagram using HTML with 8×8 images. The syntax can be localized - completely. English and German is available.

Thanks to ...

To achieve this i embedded PHP code from vyvy at (obsolete) which completely renders the chess diagram. The rest was simply a plugin template extended with the localization features and optimizing the chess images.

Many thanks to this really great plugin. Further information is available on the original website (obsolete). It was primarily developed for b2evolution.


Copy the FEN syntax between <chessdiagram></chessdiagram> or simply add an 8×8 ASCII board with the English abbreviations (kqrbnp).

You can add advanced options with “(flags)” before the chessdiagram (in both variants). Flags can be:

  • Borders: T B L R for top, bottom, left and right borders
  • Number of fields (width): positive integer
  • Colour of upper left corner: l d for light(white) or dark(black)

Fields can be marked with the character “x”.

In the german translation TBLR can be achived with OULR (oben, unten, links, rechts) and “w” or “s” is used instead of l or d (weiss, schwarz). It is up to the administrator of your site.

English version (default installation)

# Alternative 8x8 version
# options: light(white) corner in the upper left, 4 columns, borders top, bottom=unten, right

German version (default installation)

# FEN - only the start- and endpattern is localized

===== Localisation =====

$lang['kwpattern'] = 'schachdiagramm'; // Your Wikisyntax for chessdiagram (German example)
$lang['kwpieces']  = 'kdtlsbKDTLSBT';  // Your Wikisyntax for king, queen, rock, bishop, knight, pawn
                                       // Lower case is black upper is white
$lang['kwoptions'] = 'OULRws';         // Your Wikisyntax for top bottom left right white black - concerns options in ()


This is a screenshot of the first FEN diagram above.

This is a screenshot of the second FEN diagram above.

Download / Installation

Search and install the plugin using the Extension Manager. Refer to Plugins on how to install plugins manually.

Change History


  • Bugfix 8×8 alternative display if localised
  • Removed unneeded upper and lower space between borders and chessboard


  • Bugfixes
  • Compatibility with newer Dokuwiki-/ PHP-versions
  • Toolbar extension in Javascript (german for now)


  • Added security (thanks to Andy Webber)


  • Removed FEN diagnostic output


  • Second public release - Mea culpa! :-)
  • Path-through of code to the forgotten features of the original PHP implementation → additional features:
    • Mark fieds
    • Draw only parts of a diagram


  • First public release
  • All desired features of the author are implemented
  • Embedded version 1.0 of chessboard from vyvy


This product is released under the GPL 2


plugin/chessdiagram.txt · Last modified: 2022-07-30 00:14 by Klap-in

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki