O'Reilly logo

Microsoft® SharePoint® Designer 2010 Unleashed by Kathy Hughes

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Adding a Print Command to a Master Page

Chapter 16 shows you how to create a print.css file for SharePoint 2010 sites. In addition, Chapter 15 shows you how to add a print button to page layouts. You can apply the same concept to a SharePoint 2010 master page, which makes the print command available across all pages in the site, referencing the master page.

To add a print command to a master page, perform the following steps.

1. In the sample.master page, place the following JavaScript between the <head> tags in the master page:

<script type="text/javascript">if (location.search.indexOf('printfriendly')==-1){document.write('<link rel="stylesheet" type="text/css" href="corev4.css" />');}else{ document.write('<link rel="stylesheet" type="text/css" ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required