Forum:Changes in the "Printable version"?

Is there a way to make a template behave differenly when the page is viewed in it's printable version?

Ori229 07:08, 13 May 2007 (UTC)


 * The only difference between a regular view, and a printable view (printable=yes in the URL) is the skins/common/commonPrint.css file is loaded. So the laziest method, you can work with what is in that. For example:

This div should be hidden in 'printable' view


 * --Splarka (talk) 07:37, 13 May 2007 (UTC)


 * Is there a CSS class which doesn't show in the normal view, but is viewable in the printable view? Ori229 08:09, 24 May 2007 (UTC)


 * No, there isn't. But is easy. You just need to add a class in MediaWiki:Common.css with display:none;. In the printable version this class isn't defined and won't be applied. --Ciencia Al Poder (talk) -@WikiDex 13:11, 24 May 2007 (UTC)


 * I tried it, and it seems like MediaWiki:Common.css effects the printable version also??? Ori229 11:26, 29 May 2007 (UTC)


 * Hmm, try this:

/* @media screen, projection, handheld { */ .printonly { display:none; } /* } */
 * --Splarka (talk) 06:53, 30 May 2007 (UTC)


 * Nop, didn't help. Isn't what's between /* and */ ignored in CSS? or maybe it has speical meaning in MediaWiki? I have found on W3 site that "Media types" is a CSS2 thing - meaning it won't work on current version of IE? Am I wrong? Ori229 11:11, 3 June 2007 (UTC)


 * From what I know, stuff between /* and */ is comments in CSS. Anyway, I have IE7 and I use it always. I decided to test it, and the div above ("this div should be hidden in printable view") is hidden for me anyway. Are you using IE6? --Jack Phoenix (Contact) 11:45, 3 June 2007 (UTC)


 * Bah, complain complain. Try . --Splarka (talk) 05:51, 4 June 2007 (UTC)


 * Lets try (on which CSS file is this class defined?):

This div should be seen in 'printable' view. (class="printfooter")
 * Here I go complainning again: it is not viewable in both views?
 * I guess that what we need is to add a class into commonPrint.css which will show a class which is hidden in the other CSS files. Could it be done? -- Ori229 06:37, 4 June 2007 (UTC)


 * Try printing it. printable=yes will not do what you want (and won't show what will be printed anyways). --Splarka (talk) 07:48, 4 June 2007 (UTC)


 * YES! you are correct (and also print-preview works). Thanks! Ori229 09:38, 4 June 2007 (UTC)