"printer friendly" module?

1 view
Skip to first unread message

The Sage Colleges Webmaster

unread,
Dec 15, 2009, 2:56:16 PM12/15/09
to Reason Discussion
I was wondering if this is currently in existence or any helpful tips
on a way of building a "printer friendly" page where it removes the
navigation/header/footer information and leaves just the "content" of
the page. Thinking of how to accomplish this, have the page processor
check for a parameter "?printer=true" or something in the URL and if
that is the case parse only the content information. Any help is
appreciated.

- Kevin

Carolyn Zinn

unread,
Dec 15, 2009, 3:52:39 PM12/15/09
to reason-d...@googlegroups.com
Kevin,
Have you tried using media-specific CSS style sheets?

http://meyerweb.com/eric/articles/webrev/200001.html

Carolyn Zinn
Kalamazoo College
--

You received this message because you are subscribed to the Google Groups "Reason Discussion" group.
To post to this group, send email to reason-d...@googlegroups.com.
To unsubscribe from this group, send email to reason-discuss...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/reason-discussion?hl=en.


Nathan White

unread,
Dec 15, 2009, 4:19:52 PM12/15/09
to reason-d...@googlegroups.com
Hi Kevin - building on Carolyn's suggestion, Reason's built in text
only pages load a print_styles.css file with an attribute media=print.
You may be able to edit this (or if you are running a current nightly,
place a local copy in www/local/css/print_styles.css) that hides the
page regions you want hidden. You could also modify the template to
load a print style sheet on every page if you didn't want it available
only on text-only pages.

For a more brute force method that didn't use CSS, you could modify
the template to not run various modules on print-friendly pages.
Reason templates have a method called alter_page_type($page_type). It
returns a page type array that maps modules to template page regions.
You could use this method to map the regions you don't want to an
empty string to turn off a number of modules when
(isset($_GET['printer']) && $_GET['printer'] === 'true').

Nate

Matt Ryan

unread,
Dec 15, 2009, 5:35:34 PM12/15/09
to reason-d...@googlegroups.com
I would piggyback on the textonly/printer-friendly features of Reason.
The default template adds a class to the body ("textOnly") in this
mode. You can then use media-specific stylesheets in conjunction with
this class to provide the result you want, e.g.:

@media print {
body.textOnly div#mybannerid { display:none; }
}

Matt
Reply all
Reply to author
Forward
0 new messages