Read me first: before deploying pgn4web on a server
pgn4web can be easily deployed on your server and a variety of packages and plugins is available for popular web platforms. The easier option is to deploy pgn4web without any modification to the provided code.
For the integration with complex websites, you might be tempted to customize the provided code (javascript, HTML, CSS, php, ...).
Before customizing the pgn4web code in any way, read the reminder of this page.
This is particularly relevant for using pgn4web for live games broadcast applications that usually are technically more complex and are more likely to require code customizations.
Customizing pgn4web code: a tale of two tournaments
Please find below some remarks about two major chess events that used pgn4web for their sites: a very successful implementation and an implementation with a number of issues.
These notes are from the pgn4web project and show how the pgn4web project perceived those implementations; as such they do not necessarily reflect the opinion of the tournament sites developers.
How to do it right: the Max Euwe Memorial 2011
The Max Euwe Memorial 2011 took place in Amsterdam (Netherlands) from November 13th 2011 till November 20th.
pgn4web was used both for game archives and for the live broadcast of games.
The keys to a successful implementation:
- contacting the pgn4web project several weeks before the tournament
- asking questions to the pgn4web project when in doubt
- keeping the code modifications to a minimum: for instance, they adapted the HTML pages for automatically switching to a vertical layout on mobile devices
- testing extensively every modification and asking the pgn4web project for feedback
- after the event, some of the suggestions from the tournament site developers ultimately influenced the pgn4web development, namely the ability of the dynamic frame and the live fullscreen view to adapt to the screen orientation
How things might go wrong: the FIDE WWTCC 2011 from the Turkish chess federation
The FIDE Womens World Team Chess Championship 2011 took place in Mardin (Turkey) from December 18th, 2011 till December 27th, organized by the Turkish chess federation.
pgn4web was used for the live broadcast of games.
How things went wrong:
- no interaction with the pgn4web project
- every visible reference to the pgn4web project removed from the live page, presented as Powered By Turkish Chess Federation and even promoted as such in communications to other chess sites and chess blogs
- heavy customization of the pgn4web javascript and HTML code, ultimately breaking the live refresh functionality
- significant portions of javascript code removed
- removing a component handling network issues with the live PGN data updates, leading to javascript exceptions in case of network errors; those exceptions would eventually stop the automatic refresh of the live games
- insufficient testing: the exceptions above went unnoticed during development either because of insufficient testing or because testing in a local environment never triggered network errors
- increasing the PGN data refresh rate from the recommended 1 minutes to a lower value, changed repeatedly throughout the event, with a minimum of 6 seconds; while completely unnecessary, such a modification generated higher network traffic and significantly increased the likelihood of the network issues mentioned above
- no attempt to contact the pgn4web project for help: because of the issue described above, the live games refresh stopped on the pgn4web project browser after following the event for approximately 30 minutes; it took only few more minutes for the pgn4web project team to understand the issue and to identify a solution (essentially restoring a portion of javascript code incorrectly removed from the original pgn4web code); unfortunately nobody from the tournament site developers asked for help
Post scriptum: eventually the Turkish chess federation corrected the mistake and at the moment of writing their live chess viewer properly credits the pgn4web project.