Template talk:Chess diagram/Archive 1

Diagram
Standard chess diagram template is a result of discussions and votings which took place in WikiProject Chess. It is based on Template: chess position widely used in English Wikipedia. Both the template and the images of pieces were modified.

On this page I am going to place description of further modifications (if any). Please post your comments or questions in WikiProject Chess on Meta-Wiki. --Klin 21:50, 7 August 2005 (UTC)

How to use special symbols
How can I use symbol '=' in the caption? When I tried to use it directly, I see sjust something like "{ { 65 } }". I need this for GBR code. The caption should say in fact "GBR code of this study: =0323.12g3g1". Andreas Kaufmann 21:54, 9 August 2005 (UTC)


 * You can use  in the bottom caption. I'm not sure why it's necessary, but at least it works. Anyway, I [ updated] the article to fix the problem. —  Bcat  ( talk •  email ) 22:11, 9 August 2005 (UTC)

Use of template on another Wiki
Can I use this template on another wiki, by chance? Or no? I thought I'd ask first. -- Zalethon (Talk) 00:52, 19 December 2006 (UTC)


 * The template is under GFDL. You can use it, but need to put texts, which use the template, under GFDL as well. Andreas Kaufmann 14:06, 21 December 2006 (UTC)


 * Could you point me in the right direction for instructions on how to grab the template to install on another wiki? Oayfer 18:48, 8 February 2007 (UTC)

First you need to make sure that another Wiki is running on the same version of MediaWiki software as Wikipedia does (some older version might work as well). Then you need to copy the template:
 * Start article "Template:Chess diagram" in your Wiki
 * Switch to "template" on top of this page, do "edit this page", copy and paste the template text to "Template:Chess diagram" in your Wiki. Then you also need to download all chess pieces images and upload to your Wiki. Andreas Kaufmann 20:05, 8 February 2007 (UTC)

featured discussion / featured template
Was thinking, this template is a prime example of community colloboration to achieve an ingenious and pragmatic solution to a significant problem. Well, we do have featured articles, and featured pictures, but I was wondering, is there such thing as featured discussions or featured templates? Anyhow, it's been a long road since April 2004 since this was thought up, with a myriad of harmonic contributions from many Wikipedians to the entire template, lots of discovery and evolution of it since then, from the template itself, to different implementations of it (such as Template:Game of Go Position and Template:Xiangqi position which is under development mainly for the images), and then, across different languages. I would like to thank you all, for making this possible. Hurrah! :-) -- Natalinasmpf 07:15, 24 August 2005 (UTC)

Tools
FEN2Wikipedia converts FEN data (that you create directly or via a chess program) into the "Chess diagram" format.

use of Template:switch and Template:if
I was thinking, we can eliminate the need for separate templates for different boards totally if we could use the templates if and switch. We could even have the template switch boards at will:

Ie. we have another parameter, ie. "board=", that if not filled in will result in the default, if filled in, be casablanca, etc. We could even have it reversed (for each type), ie. it could be put in "perspective=" be "black" or "white", and would be the same template structure, just that the 64th parameter is now at the 8th, 32nd at the 31st, for a mirror image. However, if and case is very esoteric, so I need assistance with this. Any ideas? I also hope to introduce this for Template:Game of Go Position and Template:Xiangqi position (when it is completed). -- Natalinasmpf 18:09, 4 December 2005 (UTC)


 * I think we need something like for here to eliminate much of duplicate code. Is something like this possible in templates? Andreas Kaufmann 19:21, 4 December 2005 (UTC)


 * I don't think so - yet..."for" would require use of variables which can change - "if" simply uses parameters, which doesn't change as long as the argument to the template remains the same. A new wiki function should really make it easier to program templates. -- Natalinasmpf 21:55, 4 December 2005 (UTC)


 * We may iterate chess diagrams for switching background colours. I dont know if the foreach/for can read board sizes variables but if it works, we may use a for field iterator that recursively switches background colours. A switch that recursively changes them is already good enough - or what about a field that bypasses them? The next problem would be the variable counting. I have an idea that could make recursive calls quite nice...

Pseudocode:

Board diagram:

switch is greater than 2, do the same as above ...

template:chessfield_black:

switch is neither empty nor unset, call chessfield_white with similar parameters to above

template:chessfield_white:

switch is neither empty nor unset, call chessfield_black with similar parameters to above

template:stone: just draw a table cell containing the stone with the specified background colour

Well, we still have a problem with counting, any ideas?
 * Got it! Ever thought of how powerful #sub might be? What if we use variables for each line and use the recursive algorythm as from above?

Pseudocode:

Board diagram:


 * 1) switch is greater than 2, iterate as shown above...

template:chessline_firstblack:

//         steal first two characters and append the trail 1 is size 2 is trailing stones

template:chessfield_black

1 is size 2 is piece identifer 3 is trailing stones
 * 1) switch is not empty, call chessfield_white template as shown above
 * Note that we can now also use similar systems for working with abcdefgh and 12345678 :) please leave comments!


 * --Lazer erazer 18:58, 17 October 2006 (UTC)


 * I was also getting annoyed with the multiple templates for multiple sizes and never being able to find the one you needed. From this, i made some javascript to render add different types of chess templates off of many types of input. You should check it out, the use and ability has been documented on my talk page. let me know what you think  Matthew  Yeager  17:00, 11 October 2007 (UTC)

Any idea why this template doesn't work for me on another MediaWiki site?
I've copied across the Chess diagram template to a wiki on editthis.info. And I believe I've copied across the individual piece and square images.

Yet when I display the template, none of these images show up. Instead almost the entire screen is consumed by an orange block containing image ... instructions in each cell of the table. Thegn 11:34, 22 February 2007 (UTC)


 * Hm, images seems to be missing (see http://editthis.info/wiki/Template_talk:Chess_diagram) Are you sure that you uploaded images to the correct place? Andreas Kaufmann 19:15, 23 February 2007 (UTC)


 * Andreas, thanks for looking into this. Actually the wiki is at http://editthis.info/chess/Template:Chess_diagram  . I believe I've copied across all the images, but I could be wrong.  Thegn 22:38, 23 February 2007 (UTC)


 * Can you paste this code


 * to the discussion page of that template there so we can see what is it that really happens when you try to use it? --ZeroOne ( talk | @ ) 00:12, 24 February 2007 (UTC)


 * OK, done. I've also reset the contorl panel so that anonymous IP addresses can edit pages. Thegn 08:59, 24 February 2007 (UTC)


 * OK, I've got it figured for you. Your wiki is using an old version of the MediaWiki software - version 1.5.5. The template was using default values for the arguments. However, the support for default values was added to MediaWiki in version 1.6. I have removed the default values now and the template seems to be functioning well, although it seems that you have forgotten to upload the pawn images. --ZeroOne ( talk | @ ) 11:56, 24 February 2007 (UTC)


 * Many thanks. It's all now working, I think.  Somehow, yes, I neglected to upload the Pawn images. Thegn 14:07, 24 February 2007 (UTC)

Black points of view
I was wondering if there is an (easy) way of showing the board (with coordinates) from black points of view. Thanks a lot for any info on this Voorlandt 20:44, 28 April 2007 (UTC)


 * No, there isn't. —This comment was added by Sibahi (talk • contribs) 21:36, April 28, 2007 (UTC)


 * As a matter of fact it is.. I might put the solution up here one of these days.. Its almost finished on my personal wiki (based on this template, for which I d like to thank everyone involved - & sorry for these multiple edits here, but I forgot to sign & date) - Gen 15:39, 21 July 2007 (UTC)

(outdent) Seems to me that all that's needed is to recreate, upload and use the two images showing the coordinates but with them reversed (originals Image:Chess zver 26.png and Image:Chess zhor 26.png). I am not sure if the third piped argument in the 64 square listings needs to be changed (e.g., from "a8" to "h1"), but if so that is even easier. Baccyak4H (Yak!) 13:46, 17 August 2007 (UTC)

WordPress Port
For anyone who's interested, I've ported this most excellent template to WordPress. Details can be found right here. --Viper007Bond 10:41, 6 September 2007 (UTC)

Why is there so much padding
Notice the enormous gulf between the diagrams. It looks like the chess diagrams are set up to pad 6 pixels on top, and 10 on the bottom. This seems to leave a very unsightly gap when trying to stack diagrams (both paddings are applied) and causes diagram float layout problems on any page that wants to use several diagrams. The tleft and tright CSS classes already set margins (based on the font size, not absolute pixels as the diagram template does), so why do we pad so heavily (or even at all)? Quale 02:31, 7 September 2007 (UTC)


 * I guess so, though some padding is always good to be certain, and anyway 16px isn't much gain. The problem is rather vertical margin: (set in MediaWiki:Common.css, supplementing http://en.wikipedia.org/skins-1.5/monobook/main.css that has none:

 div.tright { border: none; margin: 0.5em 0 0.8em 1.4em; }

div.tleft { border: none; margin: 0.5em 1.4em 0.8em 0; }

I guess we could decrease these manually - 1.4em on the side seems too much as well, anyway. --Malyctenar (talk) 12:52, 28 January 2008 (UTC)


 * Have removed padding (and also doubled use of tright/tleft classes in two nested divs): doesn't seem to have hurt anything, and the gap on the right seems quite reasonable now. --Malyctenar (talk) 21:09, 9 February 2008 (UTC)

Not working
User:Hairchrm posted a message on my talk page saying that the template is not displaying correctly on one of my userpages. I looked into this, and it would appear that this template is not displaying properly on any page. All empty black squares, and all normal pieces except the following are displaying as broken links:


 * White king on white square
 * Black king on black square
 * White queen on black square
 * Black queen on white square
 * Black rook on black square

Seeing as it is not just me who is having problems, I think it is likley that there is something wrong with the template. Is anyone else having problems? -- GW_Simulations User Page 17:04, 15 September 2007 (UTC)


 * Oh, by the way, the experimental SVG version (above) seems to work fine, so if there is a major and unrectifiable problem with the PNG version, then it could be resolved by replacing it with the SVG version. -- GW_Simulations User Page 20:44, 15 September 2007 (UTC)


 * I checked from the IRC, #wikipedia-tech says that there have been problems with the database/images all day and the problem is being looked into. So it has got nothing to do with this template per se and the problem should soon go away. :) &mdash;ZeroOne ( talk / @ ) 23:56, 15 September 2007 (UTC)


 * Thanks. Black squares are displaying now, but the pieces are still not working. I hope it clears up soon. --GW_SimulationsUser Page 12:23, 16 September 2007 (UTC)

White fields are too pink!!!
Nice and very useful template but I can't stand this pinkness... Is it only me and my display? —Preceding unsigned comment added by 83.6.211.147 (talk) 19:41, 25 September 2007 (UTC)


 * According to the image page, the color hexbit is #ffce9e, full red, lots of green and moderate blue. I personally wouldn't mind more green, to move the final color toward an unsaturated yellow and thus be more tan.  But I don't mind it as is.  Baccyak4H (Yak!) 20:05, 25 September 2007 (UTC)


 * I've never noticed any pinkness... I guess it's just you and your display. You could try adjusting the color temperature of your monitor, see its manual for the details. &mdash;ZeroOne ( talk / @ ) 22:29, 25 September 2007 (UTC)

The FEN feature
Honestly, I don't quite like it, even though it is a very useful tool. The reason I don't like, however, is that it doesn't look pretty in FireFox; and that, when opened, it widens the template.

I think both these problems must be addressed before changing the template like that. (I know it is not an encylopedic change, but the looks are important too.)

Two things to add: I think there should be a copy of this template that doesn't have the FEN feature, mainly for Chess Variant purposes (it's simply distracting.) The FEN template should only be used when giving a position in a game, or an endgame article, within the mother Chess Project itself, to make it easier to copy the position into a PGN editor and play it out there (instead of setting a real board.) Otherwise, I don't see what's the point for, say, the Chess960 article to contain FEN tags.

Based on some of the points above, it's probably better to use the Small Chess diagram as a field for this tag, not the original one, since it's mainly used in the example I mentioned above. I would've done all those changes myself if I knew how.

--Sibahi 22:53, 11 October 2007 (UTC)


 * this is currently being discussed on the Chess Project talk page as well. I know for sure its going to be changed to default to NOT showing the FEN and then if you do want it, you can add a parameter for only specific templates. Please join our conversation there and we would love to hear your ideas. Matthew Yeager  02:17, 12 October 2007 (UTC)

Alt text
Could we get some better alt text on these? Pick a chess article and try reading it in plain text. The diagrams are completely devoid of meaning! They all look identical, with the squares neatly labeled "a8 b8 c8 ..." but not any hint where the pieces might be. --tcsetattr (talk / contribs) 05:28, 26 January 2008 (UTC)


 * Indeed, the alts just show the position and not its content. It would be easy to add the content of parameters into it - might do it as soon as I have the time; anything more complicated is possible too, but would require a lot of programming #switches, and server power. --Malyctenar (talk) 12:52, 28 January 2008 (UTC)


 * Have added the parameters' value to alt text after the squares' names; it should be better than nothing. --Malyctenar (talk) 21:09, 9 February 2008 (UTC)

Chess Diagram maker for Windows
I've written a Windows program to generate chess diagrams for Wikipedia articles. You can download it here or go to my website and pick Downloads and get it that way. It runs under Windows, and it automatically puts the code for a chess diagram in your clipboard, or you can copy and paste it. Select the piece on the left and then click on the square. This new version 1.01 fixes some bugs and has some enhancements. Bubba73 (talk), 13:57, 20 February 2008 (UTC)

Display in Firefox
Following example doesn't display correctly, right diagram is chopped.


 * I think this template is not designed to use side-by-side, or maybe just remove the alignment. Putting additional whitespace or putting in tables might help.

--Chininazu12 02:58, 7 March 2008 (UTC)


 * It looks like a February 20 update broke something (possibly the change to a div class). I reverted. Quale (talk) 03:50, 7 March 2008 (UTC)

Mirrored chessboard (showing perspective from both white and black's point of view)
Hello, I have designed this chessboard to show both perspectives side-by-side. See User:Obuibo Mbstpo/Two handed chess board, which transcludes to User:Obuibo Mbstpo/Sandbox.

I would like to create a bit more space between the two boards and/or put the rank and file letters and numbers on it. However, do we have an image designed to show those things from black's perspective?

Obuibo Mbstpo (talk) 16:33, 8 March 2008 (UTC)

Is this any use to you? GW_Simulations User Page 17:21, 8 March 2008 (UTC)  


 * That should take care of the numbering. Not sure about spacing, though. GW_Simulations User Page 17:21, 8 March 2008 (UTC)
 * Yes! That's awesome! Where's the barnstar of chess? Ah well, maybe later. Obuibo Mbstpo (talk) 22:24, 8 March 2008 (UTC)