* {
visibility: hidden;
}
#content * {
visibility: visible;
}
Definitely the best way (IMO) is to use CSS only, setting display: none and visibility: hidden as bwente suggested. Then you don’t need a print link - it will be automatic.
Andy
Hooray! One more asp driven site taken off the web.
BTW - You can also add information to the print version by doing the opposite and hiding the content on screen and making it visible when printed.
<script type="text/javascript"><!--
if (window.print) {
document.write('<input type="image" src="/assets/images/print.gif" mce_src="/assets/images/print.jpg" style="float:left" mce_style="float:left" onclick="window.print()"'+
' value="Print This Page">'); }
// --></script>
Well, if you want to have a print-style preview inside the regular browser (not via print-menu), then you’ll have to do some kind of CSS-switching via snippet.
<?php // snippet [!styleItTakes!] $default = 'screen.css'; $print = 'print.css'; $css = $default; if($_GET['style'] == 'print') { $css = $print; } return($css); ?>
in your template:
<link rel="stylesheet" href="assets/css/[!styleItTakes!]" type="text/css" media="screen" /> <link rel="stylesheet" href="assets/css/print.css" type="text/css" media="print" />
Your print link would then be something like:
<a href="[~[+id+]~]?style=print">print this page</a>

http://lrkh.no/index.php?id=107&submenuheader=0
http://lrkh.no/index.php?id=107?style=print

<?php
// snippet [!styleItTakes!]
$default = 'lrkh.css';
$print = 'lrkh-print.css';
$css = $default;
if($_GET['style'] == 'print') {
$css = $print;
}
return($css);
?>