The Hannah Group Unlimited Web design Graphic design company
The Hannah Group Unlimited Web design Graphic design company
The Hannah Group Unlimited Web design Graphic design company  

Print button

Print ButtonThis snippet will add a print button which will put the document in a printable form.

Author: Iasmin Balaj from Amazing Discoveries
Short Description: <b>V1.2</b> - Displays the contents of a document in a print format.
Date: August 29, 2007
Last Updated: February 27,2008

Instructions:   
    1. Create a new snippet called PrintDoc. In there paste the PrintDoc.snippet.php content
   
    2. Create a new document called Print. In here put the  snippet code. The Print document ID is the ID the of the Document you just created called "Print". The question marks in the tag doe not allow it to be cached, alowing it to be cached will not clear the page you want to print, so that you can print anouthe web page.

    3. Create a new Template for this snippet and you can use the example template in the file Print.template.php; or, you could also use (blank).  This is not the template variable, you actually create a web page template. The template is a stripped down version that eliminates all the graphics and non esentials of the noraml webpage, leaving behind just the text, title of the page and the print button.

    4. Then go to the "Print" document you made in step two and assign the template you made in step 3 to this document.
    
    5. The last step is to add the snippet code to the your main website template which is assigned to all the documents where you want the Print button to appear. The Print ID is the document you created in step 2.

Optional Configuration

I have not tested this, but I believe you can use a chunk as you template for the print process rather than using a template.
Create a chunk that will be used as a template to render the documents in for Printer Friendly format. Please check the Template.chunk.txt file. Put placeholders in instead of . Then in your template tag in step 5 you would add

The document id will be the document from step 2 and the &tpl you would put the chunk name.

# VARIABLES:
&print_doc
    This is the where every document submitted will be rendered for printing.
    In here put this snippet code:

&tpl
    This is a chunk that will be used as a template for rendering the documents to be Printer Friendly. Use the Template.chunk.txt as an example.

    God bless.
    AmazingDiscoveries.org
*/

That is it.

If you have any questions email me at jeffdarst@thehannahgroupunlimited.com

Download the code  click here http://modx.com/extras/package/printdocuments

The Hannah Group Unlimited Copyright © 2005 * All rights Rescerved * Phone: Phone: 251.654.1698 * MGR Login * Email Login Featured in the National Website Design Directory