I’ve had a couple questions regarding the handy PGN viewer Chess Publisher. A bit of code can be used to change the default formatting; here are the steps:
1. The move list should be prefaced by: <div style='height:270px;overflow:auto;'>
and end with: </div>
. This causes the moves not to wrap under the board.
2. If you want a move to start on its own line, preface it with <br>
.
3. (optional) Do #3 only if you don’t want the scroll bar! You’ll need to change the height so it contains the whole move list. This also means you need to change the height in the “iframe” code Chess Publisher has you paste on your site. The iframe height should be 70 more than the div height specified in step 1.
That’s it!
It’s possible to use HTML tags in the move list as well (<b>
1. e4</b>
bold, etc.) However, using HTML formatting in the bracketed comments may interfere with the play button functionality. I don’t remember which tag triggered that problem.
Awesome!!! I’ll test it out tonight…
Handy tho it is, I am surprised that I haven’t seen others noting that embedding a chesspublisher game or two DRAMATICALLY slows down your page loading time. Is it just me?
@DS: I was wondering the same thing. I’m just starting my blog and in my first attempt to share a game, used several diagrams from Chessup.net (I think that’s the right site/url) and then found ChessPublisher.
Posts on Chessaholic and BDK’s site loaded well enough on my PC at work just now, and our connection is a hideous T1 cobbled together with what I’m guessing are copper plated midget whiskers.
I’m probably gonna keep PGN viewer stuff ‘after the jump’ so my main page isn’t affected.
For me, the speed difference is there, but not extremely noticeable. The more annoying thing for me that using Chess Publisher throws in extra links for the back button (at least in Opera, haven’t tested with another browsers).
I’ll try to keep only one game up at a time in the future.
I do plan on moving away from CP to something I can stick on my own server. In other words, combining the convenience of CP, without taking the hit of accessing someone else’s page. Just haven’t been motivated enough yet.
Derek’s concern voices why I resisted posting games for so long. Now that they have switched from applets to scripts, the problem has abated a large degree. Also, they don’t cause the browser to completely just hang like applets. It just takes a bit of time for the somewhat klunky Chesspublisher 2.0 to load while the rest of the content sits and stares at the white box.