Print this post

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
Post Reply
ned
Regular
Posts: 50
Joined: Fri May 07, 2004 4:11 pm

Print this post

Post by ned »

A "print this post" button would be nice. Any ideas how?
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Print this post

Post by garvinhicking »

[quote="ned"]A "print this post" button would be nice. Any ideas how?[/quote
]

How about this: Inside an embedded blog (where you have control over header/footer and META-Tags) you define an alternate print-stylesheet. This sets all right/leftbars and other unneccessary items to 'display:none'.

When a user now prints a page, he only sees the entry body(ies).

An improved way would be to use the Plugin API to create an event plugin which listens to the 'entry_display' hook and inserts a print button. Similar to the Karma-Vote plugin currently in CVS. This sets a button with javascript to set the active stylesheet to the print one, cals the print dialog and then re-switches to the original stylesheet.

Regards,
Garvin.
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Post Reply