Hello,
I read this topic about adding a print button. Unfortunately it doesn't work.
But first, for those who want to use it with CC5, there are two important changes in the link parameters:
1. option=com_chronoconnectivity5
2. ccname=<your connection> [instead of connectionname]
So, this is my code in the header:
and of course there's a </div> in the footer.
Everything looks fine in frontend, but nothing happens if I try to print. What did I do wrong?
I read this topic about adding a print button. Unfortunately it doesn't work.
But first, for those who want to use it with CC5, there are two important changes in the link parameters:
1. option=com_chronoconnectivity5
2. ccname=<your connection> [instead of connectionname]
So, this is my code in the header:
<script type="text/javascript"> function printPartOfPage(elementId) { var printContent = document.getElementById(elementId); var windowUrl = 'about:NAME'; var uniqueName = new Date(); var windowName = 'Print' + uniqueName.getTime(); var printWindow = window.open(windowUrl, windowName, 'left=1,top=1,width=400,height=400'); printWindow.document.write(printContent.innerHTML); printWindow.document.close(); printWindow.focus(); printWindow.print(); printWindow.close(); } </script> <a style="float:right;" href="index.php?option=com_chronoconnectivity5&ccname=Auto_leihen&print=1&layout=default&page=" title="Print" onclick="JavaScript:printPartOfPage('PRINTAREA');" rel="nofollow"><img src="templates/kwh2/images/system/printButton.png" alt="Print" /> Drucken</a> <div id="PRINTAREA">
and of course there's a </div> in the footer.
Everything looks fine in frontend, but nothing happens if I try to print. What did I do wrong?