Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Add Print Page feature


Reply


5 Posts   2766 Views

Avatar
Valorinbattle

Community Member, 95 Posts

2 November 2009 at 1:45pm

Does SS have a feature that enables visitors to print the page they're on? Some websites have icons for printing or emailing or saving pages as pdfs. Not sure how that's done, but would love to give my visitors an icon so they can print the page.

Thanks!

Avatar
Willr

Forum Moderator, 5513 Posts

2 November 2009 at 2:07pm

Well most browsers have this feature built in without adding any code to the page. CTRL+ P (Or File -> Print :D). If you want a print button for the less adept users then have a look at the sharethis module - http://silverstripe.org/share-this-module/. It includes a Print this page button which you can include on your pages.

The code to print a page is pretty simple as well - You can add a link like this to your themes Page.ss file.

<a href="#" onclick="javascript: window.print();">Print this Page</a>

Avatar
Valorinbattle

Community Member, 95 Posts

2 November 2009 at 2:09pm

Excellent - thank you once again Willr!
~ James

Avatar
SerenityIT

Community Member, 13 Posts

7 April 2011 at 8:45pm

By any chance is there a module that gives a print only view so that the template doesn't get printed out along with the content?

Avatar
Greg1

Community Member, 28 Posts

8 April 2011 at 11:08am

It is probably easiest to just do this with a Print specific CSS.

Maybe try this: http://www.alistapart.com/articles/goingtoprint/