Irish SEO,  Marketing & Webmaster Discussion

 
ThinkGeek - Cool Stuff for Geeks and Technophiles

Print view CSS

This is a discussion on Print view CSS within the Coding Help forums, part of the Webmaster Help category; I'm trying to set up a stylesheet for Printing. Essentially it takes the content of the normal CSS file, then ...


Go Back   Irish SEO, Marketing & Webmaster Discussion > Webmaster Help > Coding Help

Register Forum Rules FAQDonate Members List Calendar Search Today's Posts Mark Forums Read


Notices

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 08-01-2008, 05:48 PM
Goodshape's Avatar
Coder
Recent Blog: Iphone post
 
Join Date: Feb 2007
Location: Dublin
Posts: 59
Nominated 0 Times in 0 Posts
TOTW/F/M Award(s): 0
Goodshape will become famous soon enough
Send a message via MSN to Goodshape Send a message via Skype™ to Goodshape
Default Print view CSS

I'm trying to set up a stylesheet for Printing. Essentially it takes the content of the normal CSS file, then does the things you'd expect like setting background to white, hiding menus, etc.

This is the HTML I've got for that :
Code:
    <link rel="stylesheet" type="text/css" media="screen" href="{$base_url}style.css" title="default" />
    <link rel="stylesheet" type="text/css" media="print" href="{$base_url}print.css" title="print" />
(I'm using Smarty templating system here... $base_url is defined and that's not the problem afaik).

However, for some reason, printing the page returns a totally unstyled version. Doesn't seem to be any CSS file being passed to it at all.

Note : I've also got a 'Switch to Print View' toggle on the page itself, which calls the print.css with JavaScript, and this works fine. But printing it has the same problems as above (no style at all).

Can anyone see what I'm doing wrong here?

Thanks.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2 (permalink)  
Old 08-01-2008, 05:50 PM
Forbairt's Avatar
respect my AW-THOR-IT-AYY
Recent Blog: Geansai Gorm
 
Join Date: Jun 2007
Location: My Office, Dublin
Posts: 2,101
Nominated 2 Times in 1 Post
Nominated TOTW/F/M Award(s): 1
Forbairt will become famous soon enoughForbairt will become famous soon enoughForbairt will become famous soon enoughForbairt will become famous soon enoughForbairt will become famous soon enoughForbairt will become famous soon enoughForbairt will become famous soon enoughForbairt will become famous soon enoughForbairt will become famous soon enoughForbairt will become famous soon enoughForbairt will become famous soon enough
Send a message via AIM to Forbairt Send a message via MSN to Forbairt Send a message via Yahoo to Forbairt Send a message via Skype™ to Forbairt
Default

have you got it online and if so .. can you pm the address and I'll have a quick look ?
__________________
Forbairt Media | Web Design & Development Galway / Dublin, Ireland - coming soon ... ( vague but descriptive isn't it )
Recent Work: Safari Club African Safari Holidays - Malawi Safaris
Other Stuff: FluffyLinkulator Rapid Inclusion Service Tools
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3 (permalink)  
Old 08-01-2008, 05:59 PM
Goodshape's Avatar
Coder
Recent Blog: Iphone post
 
Join Date: Feb 2007
Location: Dublin
Posts: 59
Nominated 0 Times in 0 Posts
TOTW/F/M Award(s): 0
Goodshape will become famous soon enough
Send a message via MSN to Goodshape Send a message via Skype™ to Goodshape
Default

Sorry, no can do . It's part of a private system and you'd need a cert to access (which I can't give you).

I know that'll make troubleshooting a bit more difficult.. but can you think of any areas I should be looking at as a cause of the problem?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4 (permalink)  
Old 08-01-2008, 06:03 PM
Forbairt's Avatar
respect my AW-THOR-IT-AYY
Recent Blog: Geansai Gorm
 
Join Date: Jun 2007
Location: My Office, Dublin
Posts: 2,101
Nominated 2 Times in 1 Post
Nominated TOTW/F/M Award(s): 1
Forbairt will become famous soon enoughForbairt will become famous soon enoughForbairt will become famous soon enoughForbairt will become famous soon enoughForbairt will become famous soon enoughForbairt will become famous soon enoughForbairt will become famous soon enoughForbairt will become famous soon enoughForbairt will become famous soon enoughForbairt will become famous soon enoughForbairt will become famous soon enough
Send a message via AIM to Forbairt Send a message via MSN to Forbairt Send a message via Yahoo to Forbairt Send a message via Skype™ to Forbairt
Default

all I can think of is ... when you go to print ... only your print.css file is called ...

so anything in your style.css sheet will be ignored ...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5 (permalink)  
Old 08-01-2008, 06:10 PM
Goodshape's Avatar
Coder
Recent Blog: Iphone post
 
Join Date: Feb 2007
Location: Dublin
Posts: 59
Nominated 0 Times in 0 Posts
TOTW/F/M Award(s): 0
Goodshape will become famous soon enough
Send a message via MSN to Goodshape Send a message via Skype™ to Goodshape
Default

Woo! Fixed it

Thanks for the help Forbairt, but the problem was with the "title = 'default'" / "title = 'print'" in the stylesheet links.

Not entirely sure why (maybe some redundant javascript was causing a problem.. must investigate) but removing that has fixed the printing problems.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6 (permalink)  
Old 08-01-2008, 06:12 PM
Forbairt's Avatar
respect my AW-THOR-IT-AYY
Recent Blog: Geansai Gorm
 
Join Date: Jun 2007
Location: My Office, Dublin
Posts: 2,101
Nominated 2 Times in 1 Post
Nominated TOTW/F/M Award(s): 1
Forbairt will become famous soon enoughForbairt will become famous soon enoughForbairt will become famous soon enoughForbairt will become famous soon enoughForbairt will become famous soon enoughForbairt will become famous soon enoughForbairt will become famous soon enoughForbairt will become famous soon enoughForbairt will become famous soon enoughForbairt will become famous soon enoughForbairt will become famous soon enough
Send a message via AIM to Forbairt Send a message via MSN to Forbairt Send a message via Yahoo to Forbairt Send a message via Skype™ to Forbairt
Default

no worries ... glad I couldn't help :P

the title bit was the only thing I found weird .. but I didn't think it'd have an effect ...

good to know for future for myself as well as I've a few sites I'll need to be able to print .. coming up shortly (though the ones I have with print css .. seem to work fine at the moment ..)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #7 (permalink)  
Old 08-01-2008, 06:13 PM
louie's Avatar
Senior Member
 
Join Date: Jan 2006
Location: Dublin, Ireland
Posts: 2,048
Nominated 5 Times in 3 Posts
Nominated TOTW/F/M Award(s): 1
louie will become famous soon enoughlouie will become famous soon enoughlouie will become famous soon enoughlouie will become famous soon enoughlouie will become famous soon enoughlouie will become famous soon enoughlouie will become famous soon enoughlouie will become famous soon enough
Send a message via Yahoo to louie Send a message via Skype™ to louie
Default

was just about to tell you the the link for css stylesheet doesn't have the "title tag"
__________________
:. Web Design & Development Web Design Ireland
:. Search Engines Optimization Search Engines Optimization
:. Directory Submission Directory Submission
:. News & Press Release Ireland GiveItSocks.com
:. Used Cars Ireland, Car Parts & Car Audio Cars For Sale, Car Parts & Accessories
:. I Have 2 Find It Directory SEF Directory
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #8 (permalink)  
Old 08-01-2008, 06:22 PM
Goodshape's Avatar
Coder
Recent Blog: Iphone post
 
Join Date: Feb 2007
Location: Dublin
Posts: 59
Nominated 0 Times in 0 Posts
TOTW/F/M Award(s): 0
Goodshape will become famous soon enough
Send a message via MSN to Goodshape Send a message via Skype™ to Goodshape
Default

Yeah, I have a feeling that the title attribute was a requirement of the javascript I was using to dynamically switch stylesheets.

I've since got an (obviously, now) better version of that javascript anyway, so they were totally redundant.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
css, print, view

Thread Tools
Display Modes

Posting 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
Forum Jump

Similar Threads

Thread Thread Starter Forum Replies Last Post
ie6 css :hover display:block; issue matt-dublin Coding Help 0 17-09-2007 09:05 PM
New CSS Gallery Blog babyboy808 Site Reviews / Announcements 13 04-07-2007 12:42 PM
CSS Image Positioning borderfox Coding Help 13 08-05-2007 07:05 PM
css styles problem JESSICA Coding Help 4 14-02-2007 04:34 PM
dynamic css 7aken Coding Help 6 10-10-2006 08:13 AM


Sponsored links

Paid On Results


All times are GMT +1. The time now is 01:15 PM.


Powered by: vBulletin Version 3.7.3, Copyright ©2000 - 2008, Jelsoft Enterprises Limited.
Hosted in Ireland by Blacknight - Test your ISP |Irish Hosting Directory| Armchair.ie|Logo by Eden Web Design|Avatars by Afterglow |Latest Blog Entries | VPS HostingAd Management by RedTyger

Search Engine Friendly URLs by vBSEO 3.2.0