ChessFlash

Advanced Tips and Tricks

As we saw in Tips and Tricks (which you should read before this post), when you post a game you get generated html and javascript something like:

<script language="javascript" src="http://chessflash.com/releases/latest/showhidebase.js"></script><script language="javascript" src="http://chessflash.com/releases/latest/showhidemain.js"></script><a href="http://chessflash.com/sites/default/files/users/Glenn%20Wilson/kevingafni-NoTB-LEPer.pgn" title="Download PGN file">kevingafni-NoTB-LEPer.pgn</a><br><span><script type="text/javascript"> embedCfBasic("1027197915", "100%", "350", "pgnurl=Glenn%20Wilson/kevingafni-NoTB-LEPer.pgn&orientation=horizontal&tabmode=false", "0000ff", "000000"); </script></span>

Our first advanced trick is that you do not need the part in bold if you are publishing just on this web site. The bolded part is just a reference to the javascripts to use to embed the viewer and those references will always be present on pages here. If you are publishing to blogger, you can add the bolded text to the <head> area of your template or layout and then you will not need to repeat it in each post. If you do not know what <head> refers to or how to add something to the <head> area of your blogger template or layout please stop reading now.

Ok, just us geeks?

These are not the only scripts that I use. There is one more script that can be used to get different behavior for the embedded viewer. To see what I am talking about take a look a recent (July 10 or later) post on this ChessFlash test blog or my chess blog that has a ChessFlash viewer. Now click the permalink or Read more link to open the page for that specific post. Notice that now the viewer is open and there is no hide/show viewer widget. This behavior is controlled by including a different script on the individual post page. Blogger lets you do that.

Backup your blogger template or layout before changing it!

The code I put in the head of my blogger template or layout to do this is:
For my Classic Template blog:

<!-- Chess Flash Embed Begin -->
<script language="javascript" src="http://chessflash.com/releases/latest/showhidebase.js"></script>
<MainOrArchivePage>
<script language="javascript" src="http://chessflash.com/releases/latest/showhidemain.js"></script>
</MainOrArchivePage>
<ItemPage>
<script language="javascript" src="http://chessflash.com/releases/latest/showhideitem.js"></script>
</ItemPage>
<!-- Chess Flash Embed End -->

For my New Layout blogs:

<!-- Chess Flash Embed Begin -->
<script language='javascript' src='http://chessflash.com/releases/latest/showhidebase.js'/>
<b:if cond='data:blog.pageType == "item"'>
<script language='javascript' src='http://chessflash.com/releases/latest/showhideitem.js'/>
<b:else/>
<script language='javascript' src='http://chessflash.com/releases/latest/showhidemain.js'/>
</b:if>
<!-- Chess Flash Embed End -->

Now, I suspect that no one cares enough about this minor behavior tweak to bother doing this, but now you know how.