Home

Using a Print Stylesheet

Often people want to be able to print webpages without all the menus and graphics and with all the content fitting correctly onto a page. To do this you need to create a separate print stylesheet. It would look something like this:

themes/YOURTHEME/css/print.css

Then all you need to do to include this in your page is to run a seperate Requirements call and specify that it is for print within the init() function of your Page_controller.

mysite/code/Page.php

About the Author

Name: Aram Balakjian

Website: http://www.aabweb.co.uk

Aram is a web designer/developer running London based agency aab web. He has a strong passion for developing attractive, usable sites around the SilverStripe CMS.

Comments (3)

  • How to create the Print button to print only "textarea" like on this page?

    It would be great to have a template or tutorial here

    Posted by Victor, 27/02/2010 7:46am (5 months ago)

  • Hi Toby

    That sounds great, I'm sure I'm not the only one that would be interested in that.

    Posted by aram, 19/12/2009 6:27pm (7 months ago)

  • This page has some tips on what you might aim to do with your printer-friendly CSS: http://webdesign.about.com/od/printerfriendly/a/aa041403a.htm

    There's also the option of dealing with this on the server side, using a Printer Friendly link. I've not found anything already written on this, but could do so myself if anyone's interested.

    Posted by Toby Champion, 18/12/2009 1:39pm (7 months ago)

RSS feed for comments on this page RSS feed for all comments

Post your comment