Background
Many methods exist to creating printer versions. A few of these include:
- creating a separate HTML page for every page on your website
that is formatted to print well. - using a database to hold the page content and display the
content via either the normal template or the stripped-down printer template. - including a header.php file above your content and footer.php
below your content.
The method I will describe here is different from the usual
methods and is used on websites like CNN.
methods and is used on websites like CNN.
The basic idea is to put a hidden html comment tag at the
beginning of the main content of your webpage, and another
hidden html comment tag at the end of your content.
beginning of the main content of your webpage, and another
hidden html comment tag at the end of your content.
<!--startclickprintinclude--> The content you want to print goes here. <!--endclickprintinclude-->
The Printer Version script will open the webpage, grab
only that which is between the hidden tags, and display
it within the Printer Version template.
only that which is between the hidden tags, and display
it within the Printer Version template.