Layout selection in the URL (for example for "Print this page" links)

Feed 7 posts, 7 voices

Aug 27, 2008 13:58
Avatar
1 posts

Hi, I'd like to add a "print this page" feature to my websites and I think the best way to do this is to specify the layout in the URL like this: (server)/index.print.htm Could you please add such a feature (with the opportunity to disable it completely or restrict it to specific layouts, of course)? I doubt it would be a good idea to make a copy of every page, assigning the "None" layout to them.

 
Sep 24, 2008 00:46
Avatar
15 posts

I would like to see this feature too..

 
Sep 24, 2008 03:07
Avatar
284 posts

Just curious, what advantages does this offer over using Javascript to change the stylesheet?

 
Sep 24, 2008 04:11
Avatar
820 posts

I’m curious too (always so much more to learn!). I’ve always done this just with a different print.css call, as in:

<LINK rel="stylesheet" type="text/css" href="screen.css" media="screen"> 
<LINK rel="stylesheet" type="text/css" href="print.css" media="print"> 

I’m not sure how changing layouts on the fly gets me farther? I haven’t looked much into this, though. Just did a little googling and found a page from Smashing called Printing the Web which looks like it has some worthwhile info, though.

 
Sep 24, 2008 05:16
Avatar
26 posts

Hi everyone,

I guess this is a subject that we have all looked at at some stage…

My understanding is that if the css is set up correctly, printing will take care of itself !

Here is another couple of article’s to add to the discussion…
http://www.alistapart.com/articles/goingtoprint/
http://www.alistapart.com/articles/alaprintstyles/
( Just realised they are also on the link that David gave ! )

regards, Dave Porter

 
Sep 24, 2008 05:44
Avatar
284 posts

Oh yeah you don’t even need to use Javascript…Nice catch, guys.

 
Sep 24, 2008 06:03
Avatar
396 posts

+1 David. :-)

The correct way is by specifying a print.css like in David’s example.

 
Sep 26, 2008 08:44
Avatar
48 posts

Hey everyone,

I personally provide a ‘print-friendly version’ link (or rather a submit button) and use an if statement to deliver the appropriate css stylesheets. By default I offer css for the screen and a print css (this way, all pages are print friendly at the click of the browser’s print button).

As we’re just posting a variable to the same page, it doesn’t matter which version they bookmark, as they are one in the same page. Only when they bookmark, the user benefits fom having the menu appear because they revisit the page using the default screen and print css.

The only downside is that people who want to print the page ‘as is’ need to go about finding another way to do this. I personally find this the most expendable trade-off, as browsers disable certain aspects such as background colours and background images by default anyways.