Print button

Discuss PivotX 2.0.x extensions here, and view extensions that are available for download.

Print button

Postby Logfather » Thu Aug 27, 2009 9:28 am

I know it's a bit old fashioned but how would one go about to make a 'print button'. This means there's a button (o rly?) and if you press it an entry opens in a printer friendly version (without layout bs, just text and maybe images) so people can print it out. Personally I would like to offer this to visitors of my blog... Any thoughts on this one?
Logfather
 
Posts: 163
Joined: Sun Jul 12, 2009 9:29 am
Location: Amsterdam

Re: Print button

Postby hansfn » Mon Sep 07, 2009 11:46 am

Code: Select all
[[ link text="Print" title="Printer friendly version of this page" query="te=somedir/entrypage_print.html" ]]

where the printer friendly entry page template is "pivotx/templates/somedir/entrypage_print.html". Probably also requires that you have added "allow_template_override" with value 1 in the advanced configuration.
hansfn
Developer
 
Posts: 3282
Joined: Sun Nov 25, 2007 7:48 pm
Location: Molde, Norway

Re: Print button

Postby localhost » Tue Dec 22, 2009 9:03 am

By using a special style sheet for print it almost always unnecessary to have a special template to print your page. My print style sheet looks like this:
Code: Select all
#header,
#menu,
#entrynav,
.gadentry,
object,
.commentform,
#sidebar {
    display: none;
}

.pivotx-image {
    float: left;
    margin-right: 10px;
}

.date {
    font-size: 80%;
}

h1 a {
    color: black;
    text-decoration: none;
}

The most important stuff is shown at the top: "display: none;". Just hide whatever you don't want.
Including a print style sheet is done by adding the following line to your header, probably the _sub_header.html template:
Code: Select all
<link href="path/to/your/stylesheet/print.css" rel="stylesheet" type="text/css" media="print" />
--People who say it cannot be done, should not interrupt those who are doing it.--
User avatar
localhost
 
Posts: 57
Joined: Fri Jan 25, 2008 8:23 am
Location: NL


Return to 2.x Extensions

Who is online

Users browsing this forum: No registered users and 2 guests

cron