Adding a Printer Friendly Button to a Page Layout

A common requirement when configuring page layouts is to add a custom print button to enable users to print the contents of publishing pages via the Web interface.

The following example assumes that you have created a print.css file and saved the file in the site collection’s Style Library. To learn how to create a print.css file for SharePoint, see Chapter 16.

In my case I needed to separately add the PlaceHolderAdditionalPageHead content placeholder into the top part of my page layout because it did not exist. The page layout I had created was based on the Article Page content type.

The following JavaScript code (see Listing 15.1) differentiates normal (or screen) CSS to print CSS and switches ...

Get Microsoft® SharePoint® Designer 2010 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.