Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > CSS Print Media

CSS Print Media
Thread Tools
Dedicated MacNNer
Join Date: Nov 1999
Status: Offline
Reply With Quote
Sep 16, 2004, 02:05 PM
 
Hi--

Im building a site for a client and they want to be able to offer a "print this page" link for the articles posted to the site. How does this work? Im familiar with the media types, but how do you embed a different stylesheet in a url? Or am I thinking about this the wrong way? IOW, do I include a media type style for each of the "article" div's Im creating?

Anyone familiar with this?

ppmax
     
Dedicated MacNNer
Join Date: Mar 2001
Status: Offline
Reply With Quote
Sep 17, 2004, 10:26 AM
 
in your head insert

<link rel="stylesheet" type="text/css" media="print" href="/whatever.css" />

however that stylesheet changes the page will be how it prints.

the visitor doesn't have to click anything on the site. when they go to print the page it will print according to that sheet regardless what the other stylesheets say.
     
Fresh-Faced Recruit
Join Date: May 2003
Status: Offline
Reply With Quote
Sep 17, 2004, 05:26 PM
 
what JUnderwood said. I just set this up for a client and it works great. I mostly set new fonts and margins and set a lot of extraneous stuff to display: hidden, like the navigation and images.

here's a page from said site - just command-p and click the print preview button to see how the page is automatically reformatted.
     
ppmax  (op)
Dedicated MacNNer
Join Date: Nov 1999
Status: Offline
Reply With Quote
Sep 18, 2004, 12:59 AM
 
Thanks for the replies. I may have been unclear in my first post: "print page" isnt the same as "print story" which is what I want to do. I realize that I would need to set up a db to hold all the stories, then call that record to a new page that could use the same style sheet.

Unless I'm mistaken, I dont see a way to turn off all the ads and graphic crap that are part of the page in a style sheet--those things are part of the html for the page. The client currently creates 3 separate pages for the screen, print, and pda media types. This is hugely lame and Id like to offer them a solution that doesnt involve replicating data all over the place AND suggesting to rebuild their whole publishing pipeline.

I can remember the last time I missed seeing a simple solution staring me right in the face (yesterday!) and this may be another case of myopia. Any other suggestions?

thx
ppmax
     
Clinically Insane
Join Date: Nov 1999
Status: Offline
Reply With Quote
Sep 18, 2004, 07:22 AM
 
Originally posted by ppmax:
Unless I'm mistaken, I dont see a way to turn off all the ads and graphic crap that are part of the page in a style sheet--those things are part of the html for the page.
If there are no images in any of the stories, you could use this in a print stylesheet:
Code:
img { display: none; }
Could you send a link? Depending on how the page is coded, it may be possible to do something almost as easy which lets graphics inside stories through.
The client currently creates 3 separate pages for the screen, print, and pda media types. This is hugely lame and Id like to offer them a solution that doesnt involve replicating data all over the place AND suggesting to rebuild their whole publishing pipeline.
You can also do stylesheets specifically for handhelds, so you may be able to cut this down to only one page: the "screen" one. That should only require changes to the Web frontend, not the rest of the pipeline, and if you're adding CSS into the site then this is unavoidable anyway. In the long run, though, it'll be much easier to maintain.
You are in Soviet Russia. It is dark. Grue is likely to be eaten by YOU!
     
ppmax  (op)
Dedicated MacNNer
Join Date: Nov 1999
Status: Offline
Reply With Quote
Sep 21, 2004, 11:21 AM
 
Sorry for the late reply. Here is a link to the draft site. Any comments you may have are welcome. I have yet to finish the drop down menus for IE/Win and some position tweaks here and there.

FWIW: I dont particularly like the layout of this site--it doesnt scale well if you increase the font size. (I just implemented a design approved by the client).

There are only three links that work: The News section and the Features section. The third link is in the Features section--click on the first link in the first content box in the right column. This will bring up a page with a slightly different "article" layout.

http://paulperreault.com/gamasutra

thx
ppmax
     
Junior Member
Join Date: Sep 2003
Location: Pacific
Status: Offline
Reply With Quote
Sep 21, 2004, 06:14 PM
 
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 01:15 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2