Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I get Sitecore (and my browser) to use the Print layout?

I am adding some support to print specific pages of my site in a nice printer-friendly format. So the first thing I did was create a more-or-less blank Layout that I can drop content into. Then I went to a content page and assigned this layout to the "Print" device in Presentation Details.

That does not seem to do anything. I'm still getting the exact same output on Print Preview that I saw before I defined any Print settings. To be honest, I'm not entirely sure how this should work. Presumably, my browser has to request the page again with a new user agent (???) to get Sitecore to return a different rendering of the page... but I've tried Firefox, Chrome, and IE and get the same undesired output from my "Default" device.

Must be missing something obvious?

like image 689
Bryan Avatar asked Oct 04 '11 20:10

Bryan


1 Answers

The Print device, by default, will be used when there is a ?p=1 querystring value on the page you want to print. The print preview in the browser is simply previewing the page with the Default device.

Try putting that querystring in the address and see if you get the layout you are expecting.

As you noted, there is the ability to switch Device via a Browser Agent, but that won't be useful here. That would mainly be used for mobile device detection.

like image 98
Sean Kearney Avatar answered Nov 12 '22 22:11

Sean Kearney